[Top][All Lists]

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

Re: Legend help

From: John W. Eaton
Subject: Re: Legend help
Date: Wed, 8 Nov 2006 22:28:16 -0500

On  7-Nov-2006, Dmitri A. Sergatskov wrote:

| Since we are on the subject.
| The current version of legend fails if called before the first invocation of
| gnuplot:
| octave:1> legend("junk1")
| error: invalid row index = 0
| error: evaluating argument list element number 1
| error: evaluating argument list element number 1
| error: evaluating prefix operator `!' near line 208, column 7
| error: if: error evaluating conditional expression
| error: evaluating if command near line 208, column 3
| error: called from `legend' in file `/arch1/dima/incoming/legend.m'
| octave:1> plot(rand(5))
| octave:2> legend("junk1")
| (works now)
| octave:3>
| I do not think it is a very serious problem, but want to let you know...

I just checked in a largeish patch that fixes this problem and adds
legend.m to Octave (it should probably be removed from Octave Forge
now).  Instead of the error above, you should see

  octave:1> legend ("boxon")
  octave:2> legend ("foo", "bar")
  warning: legend: plot data is empty; setting key labels has no effect

The "boxon" setting will affect subsequent plots.  Setting key labels
with legend should happen after plotting data.

Instead of trying to extract the current key labels by saving the
current plot state and parsing the output with awk, Octave now saves
the key labels in a structure and uses that to add labels to the plot
as needed.  The legend function now just modifies the data structure.
As this change is relatively invasive, it would be good if people
could do some testing with the current plot code in Octave's CVS



reply via email to

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