help-octave
[Top][All Lists]
Advanced

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

Re: gnuplot, hold on, and line style order


From: Jonathan Stickel
Subject: Re: gnuplot, hold on, and line style order
Date: Sun, 18 Sep 2005 20:53:18 -0700
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

From what I can tell from the gnuplot manual and trial and error, your replot command actually plots 2 lines, one covering the other one. I have yet to find a way to change the properties of an existing line or point plot in gnuplot; you must start the plot over. If there is a way, I hope someone will inform us here!

Jonathan


address@hidden wrote:
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




-------------------------------------------------------------
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]