Problems with gnuplot and jpg output
Ben Abbott
bpabbott at mac.com
Fri Jun 5 19:38:15 CDT 2009
On Jun 5, 2009, at 3:57 PM, Webb Sprague wrote:
>> Hello,
>> look at the help for octave's "print" command and select the output
>> (to file
>> - "look for "-dDEVICE" parameter) that fits your needs. You can
>> generate
>> many types of files, e.g. EPS, PNG, JPEG ... all of them are
>> included.
>
> Problem is you can't run this before the plot command, which is where
> the errors come from. (I actually know matlab/ octave pretty well --
> at least I have plotted and then printed many times....)
>
>> So I hope this helps.
>
> Well, I am getting closer ... thanks!
I don't know why you're getting gnuplot errors when using x11 ...
unless your gnuplot doesn't recognize x11. Please run gnuplot, type
"show var GPVAL_TERMINALS", and let us know what terminals are listed.
Once we see what terminals your gnuplot supports you'll need to create
the environment variable "GNUTERM" and set it equal to the terminal
name that displays correctly for you.
As I'm not a windows user, but looking at octave's source it looks
like you need to have "GNUTERM=windows". If my inference is correct,
when you run octave you can do that by
setenv ("GNUTERM", "windows")
Regarding plot/print ... you do need to issue a plot command prior to
printing, but you've already done that (you got gnuplot errors, but
the command was given and octave created the graphics objects). You
can suppress the warnings by turning off the figure's visibility.
figure (1, "visible", "off")
plot (1:10)
priint -dpng test.png
However, if the setenv command above works, you shouldn't have to
resort to such tricks.
Ben
More information about the Help-octave
mailing list