|
From: sfeam <sf...@us...> - 2016-05-31 22:12:11
|
On Tuesday, 31 May 2016 03:03:51 PM Dmitri A. Sergatskov wrote: > The following octave scrip produces a bad pdf > (similar to one in https://bugzilla.redhat.com/show_bug.cgi?id=1340660 ) > > graphics_toolkit ("gnuplot") > x=linspace(-1,1,11); > y=0; > z=x; > mesh(x,y,z); > colormap([0,0,0]); > print("bad_pdf.pdf", "-dpdfcairo") > > ==== > > A gnuplot script tat demonstrates the problem is attached (it contains > binary data). > > Both firefox and chrome would render pdf anyway, but evince/xpdf/okular > would not. > > I suspect the problem with octave's > colormap([0,0,0]) > command here. > But I also think that gnuplot should not produce bad pdf. I have not yet looked in detail, but my first thought is that the gnuplot command set palette ... maxcolors 1 is a nonsense command. A palette with only one color is no palette at all. I could understand a general case script that sometimes reduced to a degenerate palette for which the endpoint colors were the same. This would correspond to gnuplot commands set palette defined (0 "black", 1 "black") But in this case I expect the "maxcolors" parameter would still be 0 (continuous interpolation) or 256 or whatever. Ethan |