[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Legend help
John W. Eaton
Re: Legend help
Fri, 10 Nov 2006 15:27:17 -0500
On 10-Nov-2006, Quentin Spencer wrote:
| I think this is the right approach for the legend function. I've removed
| the old legend.m function from octave-forge, and I've done some testing
| of the new one. The first thing I noticed is that it doesn't seem to be
| marked as command. Doesn't the
| ## PKG_ADD mark_as_command legend
| in legend.m make it automatically marked at octave startup?
Octave doesn't scan all .m files in the load path at startup, so this
is just a special tag that is used at build/install time to generate
the PKG_ADD file. I'm not sure how you installed the new legend.m,
but there should be a "mark_as_command legend" line in the
plot/PKG_ADD file if you ran "make all install" again after copying
the new legend.m to the source tree.
| Here's another thing I noticed--this was
| probably the case before, but all the same it would be nice to fix. In
| addition to storing the legend strings, attributes like position and use
| of box should be stored, so that the following code results in the
| legend being in the upper left with a box:
| octave:1> plot(rand(10,2));
| octave:2> legend('test1','test2',2);
| octave:3> legend('boxon');
| octave:4> legend('hide');
| octave:5> legend('show');
Hmm, this seems to work correctly for me. Does the position of the
legend change for you after hiding the legend? These settings
(visible, box, position), are already stored as fields of the
__plot_key_properties__ structure defined in __plot_globals__.m.
| Also, if we're interested in
| having the same default settings as Matlab (not that I care much in this
| case), the default is 'boxon'.
OK. I don't think the gnuplot box is very good by default. It seems
to be smashed into the text of the labels, at least on my system with
the X11 terminal and gnuplot 4.0. So maybe we should skip this, or
maybe only set the default this way if --traditional is used.