Add Specific Numbers to x-axis

38 次查看(过去 30 天)
Hello
I would like to add/show specific numbers in x-axis.Like numbers I showed here 52 and last number 142.

采纳的回答

Cris LaPierre
Cris LaPierre 2021-2-27
Use the xticks and possibly xticklabels function.
x=0:142;
y=linspace(0.1, 2.7,length(x));
bar(x,y)
xline(52,'m--')
xticks(sort([xticks 52 142]));
  4 个评论
Brave A
Brave A 2021-2-27
One more question please, how to remove 0/zeros from axis?
Cris LaPierre
Cris LaPierre 2021-2-27
Which zeros do you want removed?
You could either
  • delete or rename the tick label
  • delete or move the tick
  • change you axis limits to not include 0

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by