Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1259 cairolatex pdf fill patterns

closed-works-for-me
nobody
5
2015-03-23
2013-07-03
Art Vandelay
No

The lines produced by cairolatex pdf for fill patterns 4, 5, 6 and 7 are not continuous and create the impression of misalignment at the edges.
Fill patterns 1, 2 and 9 on the other hand look perfectly continuous and smooth as do all the aforementioned fill patterns in the default terminal.

To see this, take a look at the pdf file produced by

set terminal cairolatex pdf
set output "test.tex"
test
set output

Gnuplot Version 4.6 patchlevel 3
Windows8

Discussion

  • Ethan Merritt
    Ethan Merritt
    2013-07-03

    Are you 100% this is not an artifact of your pdf viewer?
    Have you tried printing the file?

     
  • Art Vandelay
    Art Vandelay
    2013-07-04

    It is visible with Foxit Rader 6.0.3, SumatraPDF 2.3.2 as well as Ocular 0.15.5.
    When printed it's visible, too.

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-04

    I am attaching the test-inc.pdf output from 4.6.3 as run here. Depending on the magnification level, I see transient small glitches in various pdf viewers but nothing that I can attribute to the file itself rather than to imperfect rendering in the viewer. You can compare it to what you get there.

    Since the gnuplot code is identical, if there is in fact a difference in the pdf output then I think we have to blame the pdf export module of your local cairo library. I have just now checked using both cairo versions 1.9.14 and 1.12.12 FWIW.

     
    Attachments
  • The Windows 4.6.3 binary ships with cairo 1.10.2 obtained from http://www.gtk.org/download-windows.html .

    Using Acrobat Reader I do not see any glitches. But using ghostscript I get jagged results, see attachment. Results are the same using Ethan's output or the one from the local Windows installation.

     
    Attachments
  • Art Vandelay
    Art Vandelay
    2013-07-04

    That's exactly what I see here.
    Acrobat Reader 9 shows the same jaggedness.

    With Ocular 0.15.5 all fill patterns of the terminal test were printed in the same fashion they were displayed. Printing the actual graphs I am working on with different fill pattens, although at least displayed jaggedly, resulted in columns with white space and a border (like pattern 0), without any pattern at all printed.

    With Acrobat Reader 9 the patterns were printed (though again a little jaggedly).

    Anyway, from what I understand it's not a gnuplot problem after all, right?

     
  • Hi,

    I think it is the same issue with antialiasing, that also happens for pm3d map plots. For the postscript terminal it was fixed some time ago (I don't know how the fix looked like), but still appears for me sometimes for the colorbox.

    The patterns are defined for a certain size, and then get stitched together, so the lines of the pattern are not contiguous and the gap appear right where two lines come together.

    For the pm3d consider e.g.

    reset
    set terminal pdfcairo
    set isosamples 100,100
    set output 'pm3d.pdf'
    set pm3d map
    splot cos(sqrt(x**2+y**2)) with pm3d
    set output
    

    But I have no idea, what could be done on gnuplot side.

    Christoph

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-04

    There was an antialiased pattern-fill rendering bug in ghostscript that persisted through many versions (at least through 8.53). It affected all view/print tools that use ghostscript as a back end. I do not know if/when it was fixed.

    I have noticed a similar problem in Firefox when rendering svg pattern-fill.

    In both cases these are problem with the rendering engine, not with the pdf (or svg) file. It is apparently a difficult problem in general to prevent artifacts from degrading the rendering of adjacent anti-aliased fill blocks. The problem can affect solid fill blocks as well as pattern-fill, particularly if there is an alpha channel.

     
  • I see the artifacts of the example I posted in all viewers I tested, except Acrobat Reader:

    okular (0.14.3)
    evince (3.4.0)
    xpdf (3.0.3)
    firefox 22.0 (the new internal viewer)
    pdftocairo 0.18.4
    ghostscript 9.05
    mupdf 0.9, 1.2
    libpoppler is version 0.18.4

    So, although it seems a viewer problem, still the question is, if there is something on gnuplot side which could be done, if most of the viewers show this artifacts.

    Christoph

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-04

    Heh. Whereas on my machines okular and pdftocairo (uses poppler 0.22.1) do not show the artifacts but acroread 9.1 is seriously problematic.

    For kicks I have attached the output of pdftocairo -png test.pdf
    The anti-aliasing causes blurring but the jagged artifact is not present.

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2013-08-02

    • status: open --> closed-works-for-me