Octave specific legend call forms

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

Octave specific legend call forms

Pantxo
Hello,

I am currently trying to rewrite the legend function and would like your opinion on an Octave specific way of manipulating legend objects. In demos we often use the following construct:

plot (1:10);
h = legend ("Hello");
legend (h, "fontsize", 20);

The last line is strange. We use "legend" to do what "set" should be doing. AFAICS this construct is not documented (only axes handles are documented to be possible as first argument). IMHO it doesn't feel natural to replace "set" by "legend" and doesn't bring any simplification so I'd like to remove this Octave specific call form.

Any opinion?

Pantxo 
Reply | Threaded
Open this post in threaded view
|

Re: Octave specific legend call forms

bpabbott
Administrator


> On Oct 10, 2019, at 15:21, Pantxo Diribarne <[hidden email]> wrote:
>
> 
> Hello,
>
> I am currently trying to rewrite the legend function and would like your opinion on an Octave specific way of manipulating legend objects. In demos we often use the following construct:
>
> plot (1:10);
> h = legend ("Hello");
> legend (h, "fontsize", 20);
>
> The last line is strange. We use "legend" to do what "set" should be doing. AFAICS this construct is not documented (only axes handles are documented to be possible as first argument). IMHO it doesn't feel natural to replace "set" by "legend" and doesn't bring any simplification so I'd like to remove this Octave specific call form.
>
> Any opinion?
>
> Pantxo  

 Matlab behaves that way.?

Ben

Reply | Threaded
Open this post in threaded view
|

Re: Octave specific legend call forms

Pantxo


Le jeu. 10 oct. 2019 à 16:26, Ben Abbott <[hidden email]> a écrit :


> On Oct 10, 2019, at 15:21, Pantxo Diribarne <[hidden email]> wrote:
>
> 
> Hello,
>
> I am currently trying to rewrite the legend function and would like your opinion on an Octave specific way of manipulating legend objects. In demos we often use the following construct:
>
> plot (1:10);
> h = legend ("Hello");
> legend (h, "fontsize", 20);
>
> The last line is strange. We use "legend" to do what "set" should be doing. AFAICS this construct is not documented (only axes handles are documented to be possible as first argument). IMHO it doesn't feel natural to replace "set" by "legend" and doesn't bring any simplification so I'd like to remove this Octave specific call form.
>
> Any opinion?
>
> Pantxo 

 Matlab behaves that way.?

Ben

No, Matlab (2019b, tested online) forbids legend objects as first argument.

Pantxo