vertical xtick labels
Eric Chassande-Mottin
echassandemottin at gmail.com
Tue Jul 21 08:26:10 CDT 2009
here is a script that illustrates how to rotate the xtick label and put them
vertically.
i thought that may be useful to others.
eric
clear
## init demo plot
clf
plot(1:4);
xtick=[1 2 3 4];
set(gca,'xtick',xtick);
xticklabel=["a";"b";"c";"d"];
set(gca,'xticklabel',xticklabel);
## get position of current xtick labels
h = get(gca,'xlabel');
xlabelstring = get(h,'string');
xlabelposition = get(h,'position');
## construct position of new xtick labels
yposition = xlabelposition(2);
yposition = repmat(yposition,length(xtick),1);
## disable current xtick labels
set(gca,'xtick',[]);
## set up new xtick labels and rotate
hnew = text(xtick, yposition, xticklabel);
set(hnew,'rotation',90,'horizontalalignment','right');
--
View this message in context: http://www.nabble.com/vertical-xtick-labels-tp24587620p24587620.html
Sent from the Octave - General mailing list archive at Nabble.com.
More information about the Help-octave
mailing list