|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
legend on every second data setHi friends,
how ca i put a legend on every second curve in a graph? octave> plot(x1, y1, '*', x1, fit_y1, '-') octave> hold on octave> plot(x2, y2, '*', x2, fit_y2, '-') Now a legend only for (x1, y1) and (x2, y2), and not the fitting curves. Any tip? Thanks in advance ... _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: legend on every second data setOn Thu, May 8, 2008 at 9:30 PM, oxy <oxyopes@...> wrote:
> Hi friends, > how ca i put a legend on every second curve in a graph? > > octave> plot(x1, y1, '*', x1, fit_y1, '-') > octave> hold on > octave> plot(x2, y2, '*', x2, fit_y2, '-') > > Now a legend only for (x1, y1) and (x2, y2), and not the fitting curves. > Any tip? > Thanks in advance ... What works under Matlab (and probably also under octave) is to re-order the children to have the children for which you want a legend first in the children list, then use "legend" command. This means: h = get(gca, 'children') % re-order handles in h set(gca, 'children', h) legend('item 1', 'item 2') Michael. _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
|
|
|
Re: legend on every second data setoxy wrote:
>> plot(x1, y1, '*;legend1', x1, fit_y1, '-') > > This does not work for me. Look > > octave-3.0.0:13> plot(g1(:,1),g1(:,2), '*;legend 1') plot(g1(:,1),g1(:,2), '*;legend 1;') Note missing ; character in the original command D, _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: legend on every second data set> plot(g1(:,1),g1(:,2), '*;legend 1;')
Perfect, thanks!!! _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: legend on every second data setAm Montag, den 12.05.2008, 19:35 +0200 schrieb oxy: > > plot(x1, y1, '*;legend1', x1, fit_y1, '-') > > This does not work for me. Look sorry for teh late reply, i was on vacation with no email access > > octave-3.0.0:13> plot(g1(:,1),g1(:,2), '*;legend 1') you forgot the second semicolon: plot(g1(:,1),g1(:,2), '*;legend 1') should be: plot(g1(:,1),g1(:,2), '*;legend 1;') > error: plot: properties must appear followed by a value > error: evaluating if command near line 58, column 6 > error: evaluating if command near line 57, column 4 > error: evaluating if command near line 55, column 2 > error: evaluating if command near line 54, column 7 > error: evaluating while command near line 41, column 5 > error: evaluating if command near line 28, column 3 > error: called from `__plt__' in file > `/usr/local/share/octave/3.0.0/m/plot/__plt__.m' > error: evaluating assignment expression near line 187, column 9 > error: called from `plot' in file `/usr/local/share/octave/3.0.0/m/plot/plot.m' > > > Any idea? Thomas Ilnseher <ilnseher@...> _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
| Free Forum Powered by Nabble | Forum Help |