help-octave
[Top][All Lists]
Advanced

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

Re: Adding "keys" to plots


From: Wonkoo Kim
Subject: Re: Adding "keys" to plots
Date: Wed, 11 Mar 98 17:03:16 -0500

> Date: Wed, 11 Mar 98 13:55:08 -0600
> From: address@hidden
> Subject: Adding "keys" to plots
>
> Well, I've pored over the manual, but have not been able to figure out
> how to add legends to plots. Octave adds line 1, line 2 etc as keys by
> default, and they can be turned off with gset nokey. But how do I add
> some specific lines to the legend?

Suppose we have phi(:,1) = x values, phi(:,2:ncols) = (ncols-1)
function values.  An example code would be

plotcmd = "";
for k = 2 : ncols
   plotcmd = sprintf ("%s, phi using 1:%d title \"-%d\" with lines", ...
                        plotcmd, k+1, k);
endfor
eval (sprintf ("gplot phi using 1:2 title \"function-1\" with lines%s",
plotcmd));

I hope this helps.

//--------------------------------------------------------------------
// Wonkoo Kim (address@hidden)



reply via email to

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