[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnuplot, hold on, and line style order
From: |
bblais |
Subject: |
gnuplot, hold on, and line style order |
Date: |
Thu, 15 Sep 2005 09:21:02 -0400 |
Hello,
I wrote a small function to change the line width of the most recent plot:
function linewidth(pid,lw)
__gnuplot_set__(sprintf('style line %d lw %d',pid,lw))
__gnuplot_raw__(sprintf('rep "" notitle with lines ls %d \n',pid));
endfunction
which works ok, but has a small problem. So, if you do:
y=rand(1,6);
plot(y);
linewidth(1,3); % make the first line style thick
this works fine. but if you do:
y=rand(1,6);
plot(y);
linewidth(1,3); % make the first line style thick
hold on;
y=rand(1,6);
plot(y); % at this point the new plot is blue, not green
% without the previous linewidth, the default is green
pause;
linewidth(2,3); % make the second line style thick
% the line turns to green
so, somehow, my function seems to change the order of the default line
styles as seen by plot, but I don't understand why. if I do a plot,
hold, plot then the two curves are red and green. if I do a plot,
linewidth, hold, plot the two curves are red and blue. I wouldn't mind,
if the legend key in gnuplot reflected the change, but it stays blue
even when I manually change the line style.
any I doing something stupid here?
thanks,
Brian Blais
--
-----------------
address@hidden
http://web.bryant.edu/~bblais
-------------------------------------------------------------
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
-------------------------------------------------------------
- gnuplot, hold on, and line style order,
bblais <=