Menu

#2281 plot datafile with steps produces sub-optimal PDF export from plot window (Windows)

None
open-upstream-bug
nobody
2021-12-25
2020-06-18
No

When plotting a datafile "with steps" in MS-Windows, you can save the plot as PDF.
When you zoom in on that PDF, you see that a plot "with lines" produced continuous lines, while a plot "with steps" produces artefacts, most likely due to con-continuous lines being output.

The screenshot attached shows an example:
The magenta line is "with linesp", the green and orange lines are "with lines", while the red and blue lines are "with steps".

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-06-24

    The wxt qt and win terminals all provide widgets to save the plot. Which one are you using?
    It actually looks to me that the issue is that the line-join property is set to something other than "rounded". For the wxt terminal you can change this by saying "set term wxt rounded". For the qt terminal there is a toggle in the toolbar widget. For the win terminal you can say "set term win rounded"; I am not sure whether there is a widget for this one.

     
    • Ulrich Windl

      Ulrich Windl - 2020-06-25

      I have a problem following your logic: My terminal was "wxt"; if it is a problem with style of line joins, shouldn't all polylines use the same style then? And if so, why do "lines" and "linespoints" look OK, while "steps" do not?
      Anyway I have "set term wxt enhanced rounded" (as it was "enhanced" before), and then replotted: The result did not change (see updated attachment with annotations ("L"=lines, "S"=steps, "LP"=linespoints)).
      Personally I suspect that "lines" and "linespoints" use one polyline for the whole line, while "steps" uses single lines.
      If you look at the corners of the red line in the attachment, it should be obvious.

       

      Last edit: Ulrich Windl 2020-06-25
  • Ethan Merritt

    Ethan Merritt - 2020-06-25

    I cannot reproduce the effect you are seeing, so I am trying to guess what might be going wrong. I attach below a screenshot of the pdf file produced by (1) running 64-bit Windows gnuplot.exe (via wineconsole on linux), (2) selecting the wxt terminal, (3) plotting data with steps (4) using the file export widget on the toolbar to save a pdf file.

    I see no hint of the artifacts that your plot suffers from, and so far as I tell tell 'with steps' uses a single polyline. Why is your plot different? I don't know. I gave you the guess I had, and nothing else comes to mind at the moment.

     
  • Bastian Märkisch

    • labels: plot steps PDF --> plot steps PDF, wxt, Windows
    • Group: -->
    • Priority: -->
     
  • Bastian Märkisch

    I can reproduce this with the wxt terminal on Windows (gnuplot 5.4.2) using a large linewidth of 10, see attachment. The result is the same on screen and for all export formats (pdf/png/emf/svg). Interestingly, direct creation of a PDF/PNG with pdfcairo/pngcairo does not show that problem.

     
    • Ethan Merritt

      Ethan Merritt - 2021-07-11

      The effect you show there, where a large linewidth makes the joins ugly, seems to be another side-effect of the upstream bug with hinting ( https://sourceforge.net/p/gnuplot/bugs/2438/ ). I predict that if you dial the hinting down to 0% in the wxt tool widget the problem will go away.

      But I don't know if that is related to the problem reported here.

       
      • Bastian Märkisch

        Confirmed. If hinting is set to zero this goes away. Any non-zero value results in broken line-joints. [#2438]

         

        Related

        Bugs: #2438

  • Ethan Merritt

    Ethan Merritt - 2021-12-25
    • status: open --> open-upstream-bug
     

Log in to post a comment.