help-octave
[Top][All Lists]
Advanced

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

Re: Print Plot Results in all Black plot in file


From: Dmitri A. Sergatskov
Subject: Re: Print Plot Results in all Black plot in file
Date: Tue, 4 Aug 2015 02:16:50 -0500

On Tue, Aug 4, 2015 at 12:41 AM, Thomas D. Dean <address@hidden> wrote:

I am struggling thru the code for print.

Is there a global value that can be set to control the output of print.

octave:> z=1:.1:pi;
octave:> plot(z,sin(z));
octave:> print("sin.png","-dpngcairo");

works.

Without -dpngcairo opts.devopt gets set to "-dpng" and print produces a black square.

It looks like the opts structure is passed to gnuplot in __gnuplot_print__.m.  As a work-around, I patched this file to force pngcairo.  Not a solution, just makes lots of scripts work, again.

I don't see any global mechanism to set a default print device.

True?


​A quick and dirty hack is to add a line

​ if (strfind (opts.devopt, "png")) opts.devopt = "pngcairo" ; endif

near the top of function print in "print.m"

(while you at it you can also similarly override pdf with pdfcairo
  (and postscript with epscairo, but that require some extra modifications))

 

Tom Dean

​Dmitri.
--


reply via email to

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