I want to make a plot, the xaxis is date, for example, one
value may be:
11:25 02/29/2008
But I want to split the string into two rows because it is
too long in one row and the plot looks very crowded.
So, the xaxis will be like this:
11:25 13:25 14:25
02/29/2008 03/01/2008 03/02/2008
Is there any way to do this in matlab?
Thanks.
Dave
One way to do it is to replace the xticklabels with regular
text objects.
Here is a link to a function I posted last week, that could
help
http://www.mathworks.com/matlabcentral/newsreader/
view_thread/163920#416254
ticks = get(gca,'XTick');
TL = get(gca,'XTickLabel');
%% split the ticklabels to two line cells or sprintf with \n
h = my_xticklabels(ticks,newlabels);
it worked for me too, but the xticks won't change when zooming. Can
this fixed?
Many thanks
Ed
It _could_ be fixed, but no time for that at the moment,
sorry. As I wrote in the earlier posts, this is a very
quick simple function I wrote to a colleaque to get a nice
printout. Intended to be used as the last one (after
zooming to the desired level and fixing the window size
etc.) before exporting the graphics.
I myself have never even needed that kind of thing in my
19 years of using MATLAB.
Anyway, I'll take a look at the zoom issue later on.
This functionality should actually be built in. Everybody,
post an enhancement request! Maybe it will happen some day.
Haven't installed 2008a yet, don't know if it is already
there...