The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 189
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

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])';
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!!!

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.