XTicks and labels problem in 2014b?

Hi Community,
I am running Matlab 2014b and I want to define the XTick positions and labels on a 3D plot. Simple enough... in previous versions I would have used the set(gca... style but the new version uses a different syntax.
This is the example given in help for doing exactly that:
x = linspace(-10,10,200);
y = cos(x);
plot(x,y)
ax = gca;
ax.XTick = [-3*pi,-2*pi,-pi,0,pi,2*pi,3*pi];
ax.YTick = [-1,-0.5,0,0.5,1];
ax.XTickLabel = {'-3\pi','-2\pi','-\pi','0','\pi','2\pi','3\pi'};
ax.YTickLabel = {'min = -1','-0.5','0','0.5','max = 1'};
the problem is that I don't get what I expect. i.e. there is no change to the axis Tick labels:
There are no errors nor warnings reported when I execute this code. Have I missed something?
Cheers James

댓글 수: 5

Adam
Adam 2015년 2월 13일
When I run that code from command line my tick labels change as they should do.
Star Strider
Star Strider 2015년 2월 13일
You can still use the get and set commands in R2014b.
James
James 2015년 2월 13일
편집: James 2015년 2월 13일
Typically, restarting my machine fixed the issue...
Thanks for your responses :)
Star Strider
Star Strider 2015년 2월 13일
If you have Win 8 or 8.1, I found that after each update, I have to reboot at least twice in order for everything on my machine to work as it should. (Wait about 10 minutes between the first and second reboot.) I mention that because there were a lot of updates this week.
James
James 2015년 2월 17일
Good to know, thanks again.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

제품

질문:

2015년 2월 13일

댓글:

2015년 2월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by