How to fix overlapping tick labels?

34 次查看(过去 30 天)
I am trying to recreate the plot above. Here is what I have:
On the bottom left of my plot -273 and -200 are overlapping. Is it possible to fix it like in the original plot above by moving the just the -273 downwards?

采纳的回答

Walter Roberson
Walter Roberson 2022-9-2
Not easily. You would have to remove -273 from the list of xticks, and then draw a line downwards extending from the y axes (making sure to turn clipping off for it) and text() the -273 into place.
Perhaps it would be acceptable to instead use xtickangle

更多回答(1 个)

dpb
dpb 2022-9-2
编辑:dpb 2022-9-3
Not so bad, just have to remember the trick, Walter... :)
Once you've got the ticks labeled as you have where you want them, then
xtk=xticklabels;
xtk(1)=strcat('\newline',xtk(1)); % prepend TeX command
xticklabels(xtk)
  4 个评论
Walter Roberson
Walter Roberson 2022-9-3
It might be the \ before the number \newline\0 codes \0 which is probably a distinct character.
dpb
dpb 2022-9-3
编辑:dpb 2022-9-3
Indeed -- there should be only one \ in the string, \newline0, the other was a typo I didn't notice; not sure how it got there.

请先登录,再进行评论。

类别

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

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by