Menu

#1828 Dashed property for terminals removed - backward comp. broken

None
closed-wont-fix
nobody
None
2016-09-15
2016-07-12
Anonymous
No

Hi, we really have a problem with the introduction of the new usage of dashed linetypes. We have quite a large software project running on different Linux distributions using the nice plotting feature of Gnuplot for many years. We simply create Gnuplot command files and the corresponding datafiles and then execute Gnuplot with that file by a system call.
Until recently, all systems used Gnuplot 4 or older, but a few weeks ago I tried a new distribution (Suse Leap 42.1) which comes with Gnuplot 5. When plotting the first diagram, I recognized that the dashed curves were not working anymore due to the introduction of "dt" and removal of the "dashed" feature for terminals.
To fix that, I introduced the "dt" feature for the linestyles, which worked for me. BUT: This resulted in a really bad and anoying behaviour for all other people working with systems using Gnuplot 4 or older, because no Gnuplot plot worked anymore and plotting of diagrams were not possible anymore!
That's the reason for the following request: Could you please keep the "dashed" terminal feature for backwards compatibility to older Gnuplot version?
The only other solution for us would be to stick to Gnuplot 4, which is actually not really a practical solution.
Kind Regards
Hendrik

Discussion

  • Karl Ratzsch

    Karl Ratzsch - 2016-07-12

    You can have the script check which gnuplot version is running it:

    if (GPVAL_VERSION >= 5.0) {
        plot dataf w l dt 2
    } else {
       set termopt dashed
       plot dataf w l
    }
    
     

    Last edit: Karl Ratzsch 2016-07-12
  • AdvaNS

    AdvaNS - 2016-07-12

    Hi,
    thanks for the help, that could work.
    Regards

     
  • Ethan Merritt

    Ethan Merritt - 2016-07-12

    See also tracker item #1407 and various others.
    If the goal is to create a script that is readable by gnuplot version 5 but executes as if it were run with gnuplot version 4, a more complete initialization script would include:

    if (GPVAL_VERSION >= 5.0) set for [i=1:9] linetype i dashtype i
    if (GPVAL_VERSION < 5.0) set termoption dashed

    Those lines should be accepted by versions 4.4 through 5.1.
    However I only guarantee the result for the PostScript terminals. Were you concerned about another terminal in particular?

    A similar issue exists for the "monochrome" keyword. The version 5 command "set mono" is not exactly equivalent to "set term mono". If you need more exact equivalence for a particular terminal you can add additional definitions to the initialization script.

     
  • Karl Ratzsch

    Karl Ratzsch - 2016-07-24

    I've wondered: The "dashed" terminal option doesn't do anything any more as of gp5.0, if I understood correctly. Shouldn't it throw a warning now?

    The windows terminal also still lists it the docs, so does "help termopt", "fig" and a few others, in 5.0pl4 and 5.1cvs.

     
    • Ethan Merritt

      Ethan Merritt - 2016-07-25

      Yeah, let's remove mention of dashed/solid from the text of "help termopt".

      I think the fig terminal really does still require "dashed" as a terminal parameter. As I understand it, the specific dash patterns by line type number are part of the fig definition so we can't readlly reimplement it to match other terminals.

      As to printing a warning - I figured that the reason to accept and ignore the "set term ... dashed" option was so that old scripts would run without generating error messages. Issuing a warning kind of defeats that purpose. OK a warning as opposed to an error wouldn't terminate execution of the script, but if you have not updated a script to use the version 5 dash syntax it should be pretty obvious from output plot

       
  • Ethan Merritt

    Ethan Merritt - 2016-09-15
    • status: open --> closed-wont-fix
    • Group: -->
    • Priority: -->
     

Log in to post a comment.

MongoDB Logo MongoDB