|
From: Daniel J S. <dan...@ie...> - 2005-08-18 19:18:35
|
Gareth,
> I am developing a program that uses Octave (and hence gnuplot) to perform
> engineering calculations and display the results in a web broswer.
>
> To do this I need to output the plots to graphics file. The program is
> attempting to keep MATLAB and Octave compatibility for interactive use of each
> of the scripts, this riases issues of plot command ordering.
>
> In an interactive terminal (x11 in our case) this is of no consequence but when
> attempting to save the output to a file (I have used both png and SVG) the
> ordering is critical as the first plot command encountered outputs to the file,
> not allowing subsequent replots, clearing, adding of titles etc.
gnuplot/Octave and Matlab is fairly consistent, but it can be frustrating. The biggest discrepancy I see is that gnuplot syntax changes plot properties (e.g., title) first and then plots. Matlab wants one to generate a plot first then change the properties. (Why, I don't know.) Yes this causes problems with multiplot.
You have to be creative with strategically placed
if exists('OCTAVE_VERSION')
graw('set term');
<or whatever other commands to gnuplot that you want>
end
and the like. Try turning off auto replot in Octave. Then Matlab/Octave might be good enough if you create a bogus Matlab plot first then issue title(), axis(), etc. I usually can manage to get what I want with code that will run in both Matlab and Octave.
Be aware that Octave is going through some changes as far as graphics commands, but I've not kept up. I'm afraid you will have to do what you can until a year or two down the road to see some re-emerging of gnuplot/Octave.
> This behaviour is not encountered by multiplots which seem to be constructed in
> a temporary terminal and then output once completed (signified by the unset
> multiplot). I cannot get this behaviour to be replicated for single plots
> however.
>
>>From reading the postings here and on Soureforge I gather that the png terminal
> is usually piped to Imagemagick's display, and that the behaviour of most other
> file based terminals has been derrived from the png terminal's. It would appear
> to me that the strength of a file based terminal is the production of a finished
> plot, saved to a file for publishing, not real time viewing in an alternative
> format.
>
> Would it not therefore make sense to have the option that once a user enters a
> 'set term png', 'set output foo.png' to construct the plot as multiplot does,
> and then output the completed plot once the 'set output' command closes the
> file?
I'm not following you. gnuplot is very flexible with screen and file plots.
Dan
|