octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave w/ gnuplot backend produces bad pdf


From: sfeam
Subject: Re: octave w/ gnuplot backend produces bad pdf
Date: Tue, 31 May 2016 18:23:28 -0700
User-agent: KMail/4.14.5 (Linux/4.1.15-desktop-2.mga5; KDE/4.14.5; x86_64; ; )

On Tuesday, 31 May 2016 03:11:44 PM sfeam wrote:
> 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.

....and it's never going to work because of code like this:

   color.c:152    gray = (double) i / (sm_palette.colors - 1);    /* rescale to 
[0;1] */

and the equivalent is hard-wired into the PostScript palette code:

   /pm3dround {maxcolors 0 gt {dup 1 ge
        {pop 1} {maxcolors mul floor maxcolors 1 sub div} ifelse} if} def

So no.  maxcolors = 1 is not a legal value.

        Ethan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]