Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Change the x-axis scale on a graph
Replies: 2   Last Post: Feb 5, 2013 5:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Milos Milenkovic

Posts: 167
Registered: 4/4/09
Change the x-axis scale on a graph
Posted: Feb 3, 2013 6:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear,
I have a special time series graph. It's looks as follows:
a = [1 431.3 0.5 454 1 476.7; 2 412.3 1.5 434 2 455.7];
x = a(:,[1 3 5])';
y = a(:,[2 4 6])';
patch(x,y,'w');
title('Time series', 'FontWeight','bold');
xlabel('Time (Months)');
ylabel('Population Size');
set(gca,'XTick',[0:4],'XLim',[0 4]);
grid on;

How to transform the scale of x axis? In particular case I want to change the values 0,1,2,3,4 with Dec 2005, Jan 2006, Feb 2006, .....

Thanks in advance!!!
Best,
Milos



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.