Thread Subject: How to display values on a plot

Subject: How to display values on a plot

From: Vicky

Date: 28 Apr, 2008 23:24:02

Message: 1 of 4

hi,

is there a way to display a value instead of circles for
points on an x-y plot?

as an simple example, suppose my data points are numbered:

indic x y
1 1.2 0.66
2 2.7 0.58
3 3.6 0.44
...

I want each the value in indic to show up in the plot
instead of default circles so that i know where each pair
of values are on the plot directly.

any way to do this?

Subject: How to display values on a plot

From: Steven Lord

Date: 29 Apr, 2008 02:24:41

Message: 2 of 4


"Vicky " <happygalpeanut@yahoo.com> wrote in message
news:fv5mai$p72$1@fred.mathworks.com...
> hi,
>
> is there a way to display a value instead of circles for
> points on an x-y plot?
>
> as an simple example, suppose my data points are numbered:
>
> indic x y
> 1 1.2 0.66
> 2 2.7 0.58
> 3 3.6 0.44
> ...
>
> I want each the value in indic to show up in the plot
> instead of default circles so that i know where each pair
> of values are on the plot directly.
>
> any way to do this?

HELP TEXT.

--
Steve Lord
slord@mathworks.com


Subject: How to display values on a plot

From: Anh Huy Phan

Date: 29 Apr, 2008 02:50:03

Message: 3 of 4

"Vicky " <happygalpeanut@yahoo.com> wrote in message
<fv5mai$p72$1@fred.mathworks.com>...
> hi,
>
> is there a way to display a value instead of circles for
> points on an x-y plot?
>
> as an simple example, suppose my data points are numbered:
>
> indic x y
> 1 1.2 0.66
> 2 2.7 0.58
> 3 3.6 0.44
> ...
>
> I want each the value in indic to show up in the plot
> instead of default circles so that i know where each pair
> of values are on the plot directly.
>
> any way to do this?


Did you try 'text' funtion?

text(x,y,num2str(indic),'HorizontalAlignment','center')

then set scaling for the x- and y-axes by axis function

axis([min(x) max(x) min(y) max(y)]

Or combine plot and text functions

plot(x,y,num2str(indic),'.')
text(x,y,num2str(indic),'HorizontalAlignment','center')

HTH,

Anh Huy Phan,

RIKEN - BSI

Subject: How to display values on a plot

From: Anh Huy Phan

Date: 29 Apr, 2008 02:50:03

Message: 4 of 4

"Vicky " <happygalpeanut@yahoo.com> wrote in message
<fv5mai$p72$1@fred.mathworks.com>...
> hi,
>
> is there a way to display a value instead of circles for
> points on an x-y plot?
>
> as an simple example, suppose my data points are numbered:
>
> indic x y
> 1 1.2 0.66
> 2 2.7 0.58
> 3 3.6 0.44
> ...
>
> I want each the value in indic to show up in the plot
> instead of default circles so that i know where each pair
> of values are on the plot directly.
>
> any way to do this?


Did you try 'text' funtion?

text(x,y,num2str(indic),'HorizontalAlignment','center')

then set scaling for the x- and y-axes by axis function

axis([min(x) max(x) min(y) max(y)]

Or combine plot and text functions

plot(x,y,num2str(indic),'.')
text(x,y,num2str(indic),'HorizontalAlignment','center')

HTH,

Anh Huy Phan,

RIKEN - BSI

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

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com