Menu

#1724 Line types > 6 not dashed anymore

None
closed-fixed
nobody
None
2016-01-09
2015-12-24
No

Even though dashtype has been introduced, the current behavious is odd: Line types 0, 2, 3, 4, and 6 are still dashed, while 5 is solid and thicker. Line types 7 and above are solid. Is this intended?

See comparison of gnuplot 4.6 patchlevel 5 and today's CVS repository as produced by standard ps_symbols.gpi. Title in the postscript file was edited afterwards.

Also, the dash types of the line types below 7 have been changed which should not be done from my perspective. The default behaviour should be identical dash types from previous versions unless a specific dash type is specified.

5 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2015-12-28

    The introduction of dashtype as a separate property, distinct from linetype, was a major factor in bumping the gnuplot major version number to 5. It was discussed extensively before the change and clearly indicated in the Release Notes for version 5.

    The version 5 equivalent to your test script is to replace "lt l" with "dt l" in each of the "set arrow" commands. There remains a minor issue that "dashtype 0" is not recognized, but that can be added if it is a problem. WIth this change your script produces output equivalent to version 4.

    Nevertheless there may be a bug lurking here. Another work-around to get version 4-like dashtype associations with linetypes is to put a line such as this in your ~/.gnuplot file:
    set for [i=1:99] linetype i dashtype i
    That works for most terminals but seems not to work in postscript for your test script. The intent was that all terminals behave alike, so this may indeed indicate a postscript terminal-specific bug.

     
  • Harald Harders

    Harald Harders - 2015-12-29

    I understand the change. Some questions/comments still remain:

    • If it was intended to separate out dash types from line types, why are the line types 0, 2, 3, 4, and 6 still dashed? Shouldn't every single line be solid if no dash type is specified explicitely? This is a bug, isn't it?

    • The skript I used was the original script which is part of the gnuplot distribution (docs/psdoc/ps_symbols.gpi). So at least the script itself needs to be updated in the distribution because it does not show the dash types.

    • In order to get a fully-functioning system, dashtype 0 should be added.

    • What about adding something like
      set dashtype auto
      which reverts the behaviour to something as it was before? This would reduce the work for gnuplot users who have used the automatic dash behaviour before without the need of such a hack you proposed.

    • Why is linestyle 5 thicker than the others?

     

    Last edit: Harald Harders 2015-12-29
  • Ethan Merritt

    Ethan Merritt - 2015-12-29

    I have added a check for "dashtype 0" that substitutes the dash properties of LT_AXIS ("lt 0"). The demo script in docs/psdoc/ps_symbols.gpi has been modified to use the version 5 syntax.
    These changes are in CVS and will be in the 5.0.2 release.

    "Why is linestyle 5 thicker than the others?"
    In accord with the goal of making all terminals behave similarly, there are now global commands "set monochrome / unset monochrome". These were added in 5.0.1. They apply to all terminal types. Setting monochrome mode selects an alternative set of linetypes that are distinguished from each other by dash pattern and/or line width rather than by color. Six monochrome linetypes are pre-defined, but you can change them or add new ones using "set monochrome linetype N {lw <lw>} { dashtype <...>}". The pre-defined monochrome linetype 5 has linewidth 2. The definitions of "set linetype N" and "set monochrome linetype N" do not collide with each other.

    As to the postscript terminal in particular, it was one of the very few terminal types that defaulted to monochrome in earlier gnuplot versions. In order to provide some level of backward-compatibility for the default settings, "set term post" is now interpreted internally as "set term post; set monochrome". That seemed likely to annoy fewer people than making it consistent with other terminal types and thus having "set term post" be interpreted as "set term post color". Neither choice would exactly reproduce the version 4 behaviour, which again was the reason for bumping the major version to 5 rather than 4.

    The "set monochrome" mechanism is obviously new, so there may well be ways to improve it.

     
  • Harald Harders

    Harald Harders - 2015-12-30

    Thanks for clarification. So it really means that having linestyle 5 being thicker and only a small number of linetypes is by purpose... I cannot follow the arguments but I understand that I will have to react for myself.
    Putting anything in ~/.gnuplot will not be the solution for me but I will copy a useful set of line style in every single gnuplot file so that it is ensured that the same results will be achieved when forwarding my files to others.

    Accordingly, this bug could be closed...

     

    Last edit: Harald Harders 2015-12-30
  • Ethan Merritt

    Ethan Merritt - 2016-01-01

    The difference between gnuplot 4 and 5 is not anything to do with the number of linestyles that are available. In both 4 and 5 you can define as many line styles as you like. The difference is that dash patterns are controlled separately in version 5, whereas in version 4 there was no way of controlling the dash pattern other than by choosing to use the patterns associated with predefined linetypes 1-8 and only if you were in a special mode like "set term postscript dashed".

    Starting in version 5.0.2 you have two choices if you want to reproduce [almost] the 4.6 results from that test script:
    (1) Replace "lt N" with "dt N" in the script. I did this for the version that will be distributed with 5.0.2
    Run the revised script using version 5.
    (2) Place the following pair of commands in your ~/.gnuplot file or execute them explicitly

       set for [n=1:8] mono linetype n dt n lw 1.0 lc black pt n
       set monochrome linetype cycle 8
    

    Run the original (version 4.6) script that uses "set lt" rather than "set dt".

    Method (1) uses the version 5 syntax directly and should work for all terminal types. However the revised script cannot be run on version 4.

    Method (2) tells version 5 how to emulate the version 4 syntax. The advantage is that the same script can be run on either version 4 or version 5. The disadvantage is that the output is terminal-dependent and I think only the postscript terminal has this many dashed lines defined (I'm not sure).

    Note: The "set monochrome linetype cycle N" command was commented out in the CVS code up till now because it was only lightly tested. I have now enabled it for 5.0.2 and also for 5.1.

     
  • Ethan Merritt

    Ethan Merritt - 2016-01-09
    • status: open --> closed-fixed
    • Group: -->
    • Priority: -->
     

Log in to post a comment.