Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ploting data

Subject: ploting data

From: Erik L

Date: 7 Jan, 2011 09:50:08

Message: 1 of 4

Hi all,

I have two vectors:
x=[1 2 3 4 5 6 7 8 9 10 11 12];
y=[0.92 0.87 0.79 0.71 0.90 0.83 0.71 0.8 0.99 0.89 0.88 0.78];
plot(x,y);

i get a line graph where y-label lies in the range 0.71(min in my y vector data) to 0.99(max in my y vector data).

i want to see the values (marks) in the range of 0 to 0.71( i-e something like 0.1,0.2,...upto 0.71). I know there is no value defined for x, but i want to just show these blank.

any help please.

thanks

Subject: ploting data

From: Abhishek Ballaney

Date: 7 Jan, 2011 10:25:06

Message: 2 of 4

"Erik L" wrote in message <ig6nkg$278$1@fred.mathworks.com>...
> Hi all,
>
> I have two vectors:
> x=[1 2 3 4 5 6 7 8 9 10 11 12];
> y=[0.92 0.87 0.79 0.71 0.90 0.83 0.71 0.8 0.99 0.89 0.88 0.78];
> plot(x,y);
>
> i get a line graph where y-label lies in the range 0.71(min in my y vector data) to 0.99(max in my y vector data).
>
> i want to see the values (marks) in the range of 0 to 0.71( i-e something like 0.1,0.2,...upto 0.71). I know there is no value defined for x, but i want to just show these blank.
>
> any help please.
>
> thanks

Hi Eric,

You can try this:

plot(x,y); grid on; axis([0 12 0 1])

Regards,
abhishek

Subject: ploting data

From: Erik L

Date: 7 Jan, 2011 11:05:06

Message: 3 of 4

"Abhishek Ballaney" <denim83@yahoo.com> wrote in message <ig6pm2$e8q$1@fred.mathworks.com>...
> "Erik L" wrote in message <ig6nkg$278$1@fred.mathworks.com>...
> > Hi all,
> >
> > I have two vectors:
> > x=[1 2 3 4 5 6 7 8 9 10 11 12];
> > y=[0.92 0.87 0.79 0.71 0.90 0.83 0.71 0.8 0.99 0.89 0.88 0.78];
> > plot(x,y);
> >
> > i get a line graph where y-label lies in the range 0.71(min in my y vector data) to 0.99(max in my y vector data).
> >
> > i want to see the values (marks) in the range of 0 to 0.71( i-e something like 0.1,0.2,...upto 0.71). I know there is no value defined for x, but i want to just show these blank.
> >
> > any help please.
> >
> > thanks
>
> Hi Eric,
>
> You can try this:
>
> plot(x,y); grid on; axis([0 12 0 1])
>
> Regards,
> abhishek

Hi Abishek,
i tried it but it will only add grid to the graph. What i want specificaly to show the values from 0 to 0.71 in some range(that will be empty). In other words i want to shift my graph above, so that i is shown a bit small.

thanks

Subject: ploting data

From: Phil

Date: 7 Jan, 2011 11:33:04

Message: 4 of 4

"Erik L" wrote in message <ig6nkg$278$1@fred.mathworks.com>...
> Hi all,
>
> I have two vectors:
> x=[1 2 3 4 5 6 7 8 9 10 11 12];
> y=[0.92 0.87 0.79 0.71 0.90 0.83 0.71 0.8 0.99 0.89 0.88 0.78];
> plot(x,y);
>
> i get a line graph where y-label lies in the range 0.71(min in my y vector data) to 0.99(max in my y vector data).
>
> i want to see the values (marks) in the range of 0 to 0.71( i-e something like 0.1,0.2,...upto 0.71). I know there is no value defined for x, but i want to just show these blank.
>
> any help please.
>
> thanks

The ticks are specified by the YTick property of the axes object. You can see the current ticks by using

get(gca, 'YTick')

You can set them to whatever you like by using:
set(gca, 'YTick', [v1, v2, ....., vn])
Where vi is the ith tick value.

eg. set(gca, 'YTick', [0, 0.1, 0.2,..., 0.71,..., 1.0])


As was said before you will also want to rescale the y axis from 0 to 1.

Tags for this Thread

No tags are associated with this thread.

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.

Contact us