how to avoid plot legend

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

how to avoid plot legend

paladini
Dear ladies and gentlemen,
when I plot 5 or 6 different lines in one picture, octave shows a legend in the
picture saying line 1 and then the related colour, line 2 and the related
colour, line 3, etc.
I don't want this legend. What can I do to avoid this legend?

Thank you very much.

Best regards

Claudia Paladini





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

Stéfan van der Walt
Hi Claudia

Use the `legend' command from octave-forge.

If you would like to change the naming of the items in the legend, you
can use

plot(x,y,";Name;")

Regards
Stéfan

On Mon, Dec 05, 2005 at 11:24:10AM +0100, [hidden email] wrote:
> Dear ladies and gentlemen,
> when I plot 5 or 6 different lines in one picture, octave shows a legend in the
> picture saying line 1 and then the related colour, line 2 and the related
> colour, line 3, etc.
> I don't want this legend. What can I do to avoid this legend?



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

Evan Monroig
On 12/5/05, Stefan van der Walt <[hidden email]> wrote:
> plot(x,y,";Name;")

I think also that you can use the following command and the legend won't appear

plot(x, y, ";;");

--
Evan



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

Michael Creel
In reply to this post by paladini
[hidden email] wrote:

>Dear ladies and gentlemen,
>when I plot 5 or 6 different lines in one picture, octave shows a legend in the
>picture saying line 1 and then the related colour, line 2 and the related
>colour, line 3, etc.
>I don't want this legend. What can I do to avoid this legend?
>
>Thank you very much.
>
>Best regards
>
>Claudia Paladini
>
>
>
>
>
>-------------------------------------------------------------
>Octave is freely available under the terms of the GNU GPL.
>
>Octave's home on the web:  http://www.octave.org
>How to fund new projects:  http://www.octave.org/funding.html
>Subscription information:  http://www.octave.org/archive.html
>-------------------------------------------------------------
>
>
>  
>
Add the line legend("off"); For more details, type help legend.



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

James R. Phillips-2
--- Michael Creel  wrote:

> >  
> >
> Add the line legend("off"); For more details, type help legend.
>
>

Or use the command

__gnuplot_set__ key off


In general there is a larger and more expressive set of plot formatting
commands available using __gnuplot_set__ (formerly gset) than with direct
octave commands like legend, deprecations notwithstanding.

jrp



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

Robert A. Macy
In reply to this post by paladini
On the antique 2.1.50 this works well...

>> gset nokey;

and stays off

      - Robert -

On Mon,  5 Dec 2005 11:24:10 +0100
 [hidden email] wrote:

> Dear ladies and gentlemen,
> when I plot 5 or 6 different lines in one picture, octave
> shows a legend in the
> picture saying line 1 and then the related colour, line 2
> and the related
> colour, line 3, etc.
> I don't want this legend. What can I do to avoid this
> legend?
>
> Thank you very much.
>
> Best regards
>
> Claudia Paladini



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

John W. Eaton-6
In reply to this post by James R. Phillips-2
On  5-Dec-2005, James R. Phillips wrote:

| In general there is a larger and more expressive set of plot formatting
| commands available using __gnuplot_set__ (formerly gset) than with direct
| octave commands like legend, deprecations notwithstanding.

Yes, but every one of them will fail when/if Octave's default graphics
engine moves from gnuplot to something else.

Symbols with names like __XXX__ are internal Octave variables and
functions, so they should be avoided unless you you are willing to
accept that your code may break in the future due to changes in the
behavior of Octave's internals.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

abl5
On Mon, 5 Dec 2005, John W. Eaton wrote:
> Yes, but every one of them will fail when/if Octave's default graphics
> engine moves from gnuplot to something else.
>
> Symbols with names like __XXX__ are internal Octave variables and
> functions, so they should be avoided unless you you are willing to
> accept that your code may break in the future due to changes in the
> behavior of Octave's internals.

What is replacing gnuset? I went hunting a while back and couldn't figure
that out, so I ended up using gset commands because they work now.

Arwen



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

James R. Phillips-2
In reply to this post by John W. Eaton-6
--- "John W. Eaton" <[hidden email]> wrote:

> On  5-Dec-2005, James R. Phillips wrote:
>
> | In general there is a larger and more expressive set of plot formatting
> | commands available using __gnuplot_set__ (formerly gset) than with direct
> | octave commands like legend, deprecations notwithstanding.
>
> Yes, but every one of them will fail when/if Octave's default graphics
> engine moves from gnuplot to something else.
>
> Symbols with names like __XXX__ are internal Octave variables and
> functions, so they should be avoided unless you you are willing to
> accept that your code may break in the future due to changes in the
> behavior of Octave's internals.
>
> jwe
>

I thought I might get a response on that statement.

Well, I'm just calling it the way I see it, from a user's perspective.  I
accept the probability of future breakage in return for actually getting useful
results today.  Availability of source code mitigates this issue, since today's
octave code will not only be available today, but into the indefinite future.

On a related subject: maybe it is Stockholm Syndrome, but I've grown somewhat
comfortable with gnuplot.  While I recognize the compatibility goals of the
project, I believe I and many users would be satisified with improving the
speed and convenience of using gnuplot vs implementing the entire handle
graphics enchilada.  Note: I am not recommending this approach, just
identifying my perspective as a user.

jrp



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

John W. Eaton-6
On  5-Dec-2005, James R. Phillips wrote:

| On a related subject: maybe it is Stockholm Syndrome, but I've grown somewhat
| comfortable with gnuplot.  While I recognize the compatibility goals of the
| project, I believe I and many users would be satisified with improving the
| speed and convenience of using gnuplot vs implementing the entire handle
| graphics enchilada.  Note: I am not recommending this approach, just
| identifying my perspective as a user.

If you like gnuplot, then I think the best thing is to use it
directly, by writing out data files and then using gnuplot to plot the
files.  I do this all the time, usually in combination with Make.
That way, the computations (done with Octave) are separated from
plotting (with gnuplot).   If a .m file changes, I generate new data.
If a .gp file changes, I generate a new plot, but I don't have to
perform the computations again just because a plot label changes.  I
find this works well.  For interactive use, I may make simple plots
from Octave, but I don't need all the control over line widths and
labels that gnuplot allows.  YMMV.

In any case, I don't think it is reasonable to expect Octave to give
you a 100% compatible gnuplot command parser at the Octave prompt.  It
seems like a waste of effort to try do duplicate the entire gnuplot
language inside Octave.  Implementing part of it seems to be worse
than not having it at all.  For example, we get an endless stream of
messages asking why

  gplot x with lines

works but

  gset xrange x_lo:x_hi

does not.  If we implement this particular feature, then we get
questions about other missing features.  If we implement most or all
of them, then we have to track changes to gnuplot, or people will
complain that Octave's implementation of gnuplot's language is not the
same as gnuplot.  Having this kind of problem with Matlab's language
is more than enough hassle.  I'd rather avoid another set of
compatibility issues.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: how to avoid plot legend

James R. Phillips-2

--- "John W. Eaton"  wrote:

> If you like gnuplot, then I think the best thing is to use it
> directly, by writing out data files and then using gnuplot to plot the
> files.  I do this all the time, usually in combination with Make.
> That way, the computations (done with Octave) are separated from
> plotting (with gnuplot).   If a .m file changes, I generate new data.
> If a .gp file changes, I generate a new plot, but I don't have to
> perform the computations again just because a plot label changes.  I
> find this works well.  For interactive use, I may make simple plots
> from Octave, but I don't need all the control over line widths and
> labels that gnuplot allows.  YMMV.
>[...]

This is an interesting approach that I will pursue in the near future.  I am
very enthusiastic about the use of make with octave, which is why I submitted
make.m to sources at octave dot org.  I will be interested to learn how to
extend this approach for direct use with gnuplot.

jrp
 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------