Thread Subject: Labelling with text (names) the contour lines in contour

Subject: Labelling with text (names) the contour lines in contour

From: Sabrina Speich

Date: 9 Feb, 2010 14:59:06

Message: 1 of 3

Hi,

I would like to know if there is a solution to label the contour lines with names (hence text strings) I would like tu use instead of numbers.

Is there any solution for this ? I am not able to find it in the Matlab Manual or newsletters etc


Thank you for helping me with this.

Best regards,


Sabrina

Subject: Labelling with text (names) the contour lines in contour

From: Rich Ellis

Date: 9 Feb, 2010 22:25:06

Message: 2 of 3

Try using the CLABEL function to get the text object handles and then set
the text object "String" property to the text you want. Something like this:

[C,h] = contour(peaks(20),3);
th = clabel(C,h);
set(findobj(th,'String','0.59778'),'String','Base Line')

where '0.59778' is the numeric label of the line whose label you want to
change and 'Base Line' is the label you want that line to use.


"Sabrina Speich" <speich@univ-brest.fr> wrote in message
news:hkrt7p$oi9$1@fred.mathworks.com...
> Hi,
>
> I would like to know if there is a solution to label the contour lines
> with names (hence text strings) I would like tu use instead of numbers.
>
> Is there any solution for this ? I am not able to find it in the Matlab
> Manual or newsletters etc
>
>
> Thank you for helping me with this.
>
> Best regards,
>
>
> Sabrina
>

Subject: Labelling with text (names) the contour lines in contour

From: Sabrina Speich

Date: 10 Feb, 2010 07:34:29

Message: 3 of 3

Thank you Rich,

it works!


Sabrina

"Rich Ellis" <rich@mathworks.com> wrote in message <hksnc4$oe7$1@fred.mathworks.com>...
> Try using the CLABEL function to get the text object handles and then set
> the text object "String" property to the text you want. Something like this:
>
> [C,h] = contour(peaks(20),3);
> th = clabel(C,h);
> set(findobj(th,'String','0.59778'),'String','Base Line')
>
> where '0.59778' is the numeric label of the line whose label you want to
> change and 'Base Line' is the label you want that line to use.
>
>
> "Sabrina Speich" <speich@univ-brest.fr> wrote in message
> news:hkrt7p$oi9$1@fred.mathworks.com...
> > Hi,
> >
> > I would like to know if there is a solution to label the contour lines
> > with names (hence text strings) I would like tu use instead of numbers.
> >
> > Is there any solution for this ? I am not able to find it in the Matlab
> > Manual or newsletters etc
> >
> >
> > Thank you for helping me with this.
> >
> > Best regards,
> >
> >
> > Sabrina
> >
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com