Multiple mesh plot with a correct legend

Ben Abbott bpabbott at mac.com
Mon Aug 11 05:50:43 CDT 2008


On Aug 11, 2008, at 1:54 AM, Xandri Farr wrote:
> -----Original Message-----
> From: Ben Abbott [mailto:bpabbott at mac.com]
> Sent: 08 August 2008 02:50 PM
> To: Xandri Farr
> Cc: help-octave at octave.org
> Subject: Re: Multiple mesh plot with a correct legend
>
>
> On Aug 8, 2008, at 2:31 AM, Xandri Farr wrote:
>
>> Hi there
>>
>> Please forgive me for re-sending this e-mail. In the haste of
>> sending the e-mail I forgot to add a Subject line to my e-mail.
>>
>> Can somebody please assist me to plot a multiple mesh plot with a
>> user-defined legend.
>> So far the following works to plot more than one mesh plot in one
>> window on one axis...
>>
>>   mesh(x,y,z)
>>   hold
>>   mesh(i,j,k)
>>
>> However, I can not manage to add a legend that describes each mesh
>> and its colour.  The figure just displays
>> line 1, line2, etc with the colour of the mesh.
>>
>> I would like to rename these "lines".
>
> Can you tell us which version of Octave your are running?
>
> In any event, take a look at "help colormap" ... does that do what you
> need?
>
> Ben
>
> Hi Ben
>
> Thank you for the response.  I'm using GNU Octave, version 2.1.73.
> I had a look at "help colormap" but this as far as I understand only
> manages the colour of the different plots.  The part I would really
> would like to edit is the description given to each mesh/surface
> drawn on the axis.  Something like "help legend" provides the  
> following:
>
> " Legend puts a legend on the current plot using the specified strings
>  as labels. Use independant strings (@var{st1}, @var{st2},  
> @var{st3}...), a
>  matrix of strings (@var{matstr}), or a cell array of strings  
> (@var{cell})
>  to specify legends. Legend works on line graphs, bar graphs, etc..."
>
> I could not apply this command successfully to a multiple mesh plot.
>
> Your help will be appreciated.
>
> Regards
> Xandri

I'm unfamiliar with 2.1.73. Octave has been under very aggressive  
development. The most recent release is 3.0.1 and is significantly  
more compatible with Matlab. I recommend you upgrade.

To label different meshes on the same plot, I recommend you use the  
"text" command, see "help text". This may not be available under  
2.1.73 (?).

Ben


More information about the Help-octave mailing list