How do I change the values for x-axis ?
178 次查看(过去 30 天)
显示 更早的评论
Hi all,
here is my code with the figure
MoyenneDeviant=mean(Deviant,2);
plot(MoyenneDeviant)
legend ("deviant")
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/486908/image.jpeg)
But the values of the x axis are not the one i wanted
after reading an answer to a similar question, I wrote this code to replace the ticks by other
xticks([0 50 100 150 200 250])
set(gca,'XLim',[-100 900]);
set(gca,'YLim',[-3 3]);
set(gca,'Xtick',[-100 100 300 500 700 900])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/486913/image.jpeg)
but it changed the scale instead of the values.
How do I get to change the values by the ones I want ?
MATLAB 2017a
Thanks
0 个评论
采纳的回答
更多回答(1 个)
Mischa Kim
2021-1-13
编辑:Mischa Kim
2021-1-13
Hi Anne-Lise, do you mean changing the tick labels? See this answer. If this does not address your question, how exactly do you want "to change the values by the ones I want"?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!