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