Say I have been tracking my weight each month (on and off for a couple of years), and I want to plot the data, such that:
I thought this could be achieved by simply writing:
x = ["Jun 2015", "Jul 2015", "Aug 2015", "Sept 2015"];
y = [75.4, 75.1, 72.6, 71.6];
plot(x,y);
But this produces an error. How can I approach this?
And on a related note: How can I have a break in the x-axis? Say that I did not weigh myself on some months, and so I want a break in the x-axis to indicate that.
You can use the axes entities to do that:
n=size(y,"*");
plot(1:n,y)
ax=gca();
x_ticks=ax.x_ticks;
x_ticks.locations=1:n;
x_ticks.labels=x;
ax.x_ticks=x_ticks;