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:
personalised axis

Subject: personalised axis

From: Marcio Barbalho

Date: 2 Jun, 2010 13:16:04

Message: 1 of 5

Dear friends...

Please, could you give a few ihints on how to generate an axis with personalised scale and make it equispaced:?

t = [00 01 02 03 05 10 50 100 200];
y = [01 04 09 10 10 10 10 010 010];

It's a process control problem, and I would like to show the dynamic behaviour of the system by "equi-spacing" the x axis.

Many thanks

Subject: personalised axis

From: Steven Lord

Date: 2 Jun, 2010 13:32:55

Message: 2 of 5


"Marcio Barbalho" <marciobarbalho@live.com> wrote in message
news:hu5lik$79m$1@fred.mathworks.com...
> Dear friends...
>
> Please, could you give a few ihints on how to generate an axis with
> personalised scale and make it equispaced:?
>
> t = [00 01 02 03 05 10 50 100 200];
> y = [01 04 09 10 10 10 10 010 010];
>
> It's a process control problem, and I would like to show the dynamic
> behaviour of the system by "equi-spacing" the x axis.

Change the XTickLabel and YTickLabel properties, but don't change the XTick
or YTick properties.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#XTickLabel

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: personalised axis

From: Marcio Barbalho

Date: 2 Jun, 2010 13:56:05

Message: 3 of 5

"Steven Lord" <slord@mathworks.com> wrote

> Change the XTickLabel and YTickLabel properties, but don't change the XTick
> or YTick properties.
>

Didn't get it. Tried a couple of things and it didn't work out.
Could you please give an example?

Very much appreciated

Subject: personalised axis

From: Steven Lord

Date: 2 Jun, 2010 14:32:33

Message: 4 of 5


"Marcio Barbalho" <marciobarbalho@live.com> wrote in message
news:hu5ntl$g5b$1@fred.mathworks.com...
> "Steven Lord" <slord@mathworks.com> wrote
>
>> Change the XTickLabel and YTickLabel properties, but don't change the
>> XTick or YTick properties.
>>
>
> Didn't get it. Tried a couple of things and it didn't work out.
> Could you please give an example?
>
> Very much appreciated
>

plot(1:10)
set(gca, 'XTickLabel', {'17', '23', 'hut', 'hut', 'hike!', '3.14', '2.718',
'0', ' ', '1+2i'})

As long as you can construct the right cell array of labels, you can give
your axes just about any labels you want.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: personalised axis

From: Marcio Barbalho

Date: 2 Jun, 2010 15:40:06

Message: 5 of 5

"Steven Lord" <slord@mathworks.com> wrote

> plot(1:10)
> set(gca, 'XTickLabel', {'17', '23', 'hut', 'hut', 'hike!', '3.14', '2.718',
> '0', ' ', '1+2i'})
>
> As long as you can construct the right cell array of labels, you can give
> your axes just about any labels you want.

Still nor working. I believe this has little to do with labelling.

In this problem, both x and y's sizes are (6400,1), of course. X is linearly spaced. starting at 0 (zero) and ending at 128 hours.

The most important interval of time is from 0 to 6 hours, that's why I am picking some elements of x and y:

ind = [1:200,500,1000,5000,6400]; pos stands for 'index'

plot(x(ind),y(ind))

x axis should look like this:

0 1 2 3 4 5 6 25 50 100 128

How do I do that?

Thanks a million.

Tags for 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