help-octave
[Top][All Lists]
Advanced

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

Re: plotting


From: Dmitri A. Sergatskov
Subject: Re: plotting
Date: Fri, 19 Nov 2004 23:31:49 -0700
User-agent: Mozilla Thunderbird 0.8 (X11/20041020)

Matt Funk wrote:
Hi,
can somebody tell me why :

graphoutput =sprintf("octave_output/graph_quantity%g__point_x%g_y%g.eps",quantity,Vm_Points(1,k),Vm_Points(2,k));
a = sprintf("gset output \"%s\"", graphoutput);
eval(a);                                                                
eval('gset term postscript eps');
eval('gset size 1.0,1.0');
eval('gset key top left')
hold on;                
grid
titel = sprintf("Value of Vm at point x=%g,
y=%g\n",Vm_Points(1,k),Vm_Points(2,k));
title(titel);   
xlabel("time [ms]");
ylabel("Transmembrane voltage [mV]");         
plot(Dts,simple_MaxError(:,1),';1;',Dts,simple_MaxError(:,2),';2;');
hold off;               
closeplot;


only prints the first argument to file (namely simple_MaxError(:,1) ) ?


thanks
mat


It is a very peculiar looking octave code...

But your problem is that you are mixing low-level with
high-level plotting commands. plot() meant to plot
on a screen not on to "hardcopy" type device.
You end up with two-page output and the second page
will have both of your plots.
The preferred way of doing what you are trying to
archive is to do
plot(...)
print("filename", "-dps2")
You can construct the print command with sprintf
and then eval() it if you wish.

You can do with gset commands -- you can check archives for
detailed instructions.
The following script will do something similar to what you want.
(I will skip sprinf and eval parts)
Remember that you need to have automatic_replot = 0
here.

gset out "/dev/null"
gset term post eps color
idx=linspace(-10,10,201);
s=zeros(2,201);
s(1,:)=sin(idx);
s(2,:)=cos(idx);
plot(idx, s(1,:),";1;",idx, s(2,:),";2;")
gset out "test1.ps"
replot
closeplot


Regards,

Dmitri.
--



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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