I cannot figure out how to rotate my xtick labels in a 3d graph. Someone previously suggested:
set(get(gca,'xlabel'), 'Rotation',90)
But when I do this, nothing changes.
The whole code is:
width = 0.7
zheight = 500
set(0,'DefaultAxesLineStyleOrder',{'-*',':','o'})
d=bar3(a,x,width)
set(gcf,'color','w');
zlim([0 zheight])
set(gca,'FontSize',14 ,'FontWeight','bold')
set(gca, 'YTick',1:8, 'YTickLabel',{'1','2','4','8','12','16','20','24'})
set(gca, 'XTick',1:7, 'XTickLabel',{'a' 'b' c' 'd' 'e','f','g'})
set(get(gca,'xlabel'),'rotation',90)
As of matlab version R2014b, this is built into matlab. (As noted in the rotateXLabels package from the answer by @lakesh)
You can rotate the labels:
set(gca, 'XTickLabelRotation', 90)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With