both text and numbers in axis

2 次查看(过去 30 天)
I'm wondering if matlab is able to customize the axis where some of the ticks are strings and some of the ticks are number?
or inconsistent tick marks (for example, tick marks 1-5 in 1 tick intervals, then 5-100 in intervals of 5?

采纳的回答

Walter Roberson
Walter Roberson 2012-6-20
set(gca, 'XTick', [1 2 3 4 5 10 15])
set(gca,'XTickLabel',{1 2 3 4 'Hello' 10 15})
  3 个评论
Walter Roberson
Walter Roberson 2012-6-20
I'm not sure what you are referring to about primary and secondary axis? Are you using plotyy() ?
David C
David C 2012-6-21
yessir! but i figured it out
I had to manually scale the axes to make the ticks match the values
I'm grateful as always :)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by