Menu

#1545 epslatex: how to get dashed lines?

closed-fixed
nobody
None
5
2015-03-23
2015-01-23
Ryo
No

Hello,

I haven't been able to obtain dashed lines on the epslatex terminal on gnuplot 5.0. I can do that on gnuplot 4.6.6. I use this script:

#--- test.gp -----
epslatex = 1  # true
if (epslatex) \
   set terminal epslatex standalone monochrome dashed; \
   set output "tmp2.tex"; \
else \
   set terminal postscript eps monochrome dashed; \
   set output "tmp.eps"

plot sin(x) lt 2, cos(x) lt 4
# Then, type "pdflatex tmp2" on the command line

and run this on the unix command line:

$ gnuplot test.gp
$ pdflatex tmp2

With gnuplot 5.0, the resultant tmp2.pdf shows only solid lines, whereas with gnuplot 4.6.6, the result shows dashed lines. The postscript driver (see the "if" statement in the above script) gives dashed lines on both versions of gnuplot.

I use a Mac OS 10.10.1 machine and I use gnuplot 5.0 patchlevel 0 installed through homebrew and gnuplot 4.6.6 which I complied from the source.

By the way, the documentation of epslatex doesn't include the "dashed" keyword any longer

http://www.gnuplot.info/docs_5.0/gnuplot.pdf

but I guess it's a simple omission just in the documentation, because whey I type "set terminal epslatex dashed", it's accepted without an error message.

Anyway, I'm struggling to get dashed lines from the epslatex terminal on gnuplot 5.0. Thank you for your help.

Best regards,

Ryo

Discussion

  • Ethan Merritt

    Ethan Merritt - 2015-01-23

    The support for dashed lines has changed completely in version 5.
    Please read the Release Notes and the New Features section of the user manual.
    In brief:

    • "dashed" is no longer a terminal keyword (as you already noticed). So that old scripts don't trigger an error message, it is ignored silently.

    • Instead you can get dashed lines at any time by using the keyword "dashtype",
      short form "dt". So your test commands could be

        plot sin(x) dashtype 2, cos(x) dashtype 4
    
    • All linetypes default to solid, but if you want to make the linetype itself have a dashtype you can redefine it like this:
        set linetype 2 dashtype 2 linecolor "grey" linewidth whatever ...
    
    • There is a new demo "dashtypes.dem" that shows some examples and can be used to test that it all is working on your favorite terminal.
     
    • Ryo

      Ryo - 2015-01-23

      Thank you for your quick response! Unfortunately, "dashtype" doesn't seem to produce dashed lines:

      epslatex = 1  # true
      if (epslatex) \
         set terminal epslatex standalone monochrome; \
         set output "tmp2.tex"; \
      else \
         set terminal postscript eps monochrome; \
         set output "tmp.eps"
      plot sin(x) dashtype 2, cos(x) dashtype 4
      # Then, type "pdflatex tmp2" on the command line.
      

      I've removed the keyword "dashed" from the "set terminal" command and I now use the "dashtype" feature.

      The postscript driver gives dashed lines (epslatex = 0 in the above script).

      Perhaps I'm doing something incorrectly?

      Ryo

       
  • Ethan Merritt

    Ethan Merritt - 2015-01-23

    I see what you mean. There is something different about the epslatex terminal.

    Can you use the cairolatex terminal as a work-around?

     
    • Ryo

      Ryo - 2015-01-23

      Can you use the cairolatex terminal as a work-around?

      Yes! I didn't know that terminal. Thank you! It's more than a "work-around". Although I haven't compared it carefully with epslatex, the plot from cairolatex looks perfect.

      Regards,
      Ryo

       
  • Ethan Merritt

    Ethan Merritt - 2015-01-24
    • status: open --> closed-fixed
     
    • Ryo

      Ryo - 2015-01-25

      "closed-fixed" --- Does that mean you will not try to fix the epslatex driver? which would be fine with me of course, but I thought that other people may hit upon the same problem.

      Regards,
      Ryo

       
  • Ethan Merritt

    Ethan Merritt - 2015-01-25

    No. "closed - fixed" means that the problem has now been corrected in the CVS source code for 5.0 and 5.1.

    The problem turned out to be similar to one fixed recently for several other terminals with a "monochrome" terminal setting. I would not be too surprised if additional problem cases are found. This is all tied up with the version 5 changes to separate linetype and dashtype. The monochrome flag in these terminals causes a separate code path to be executed, and it wasn't as well tested as the primary path.

     
    • Ryo

      Ryo - 2015-01-26

      'No. "closed - fixed" means that the problem has now been corrected' --- Ah, thank you for your kind explanation and sorry for bothering you with my misunderstanding. -Ryo

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.