plots with xlabel too long of a string for the plot
3 次查看(过去 30 天)
显示 更早的评论
hi,
i need to make a plot that has doubles for the y-axis and strings for the x-axis
1,'abc'
2,'def'
3,'ghi'
4,'jkl'
5,'mno'
...
i've been plotting using the index as the x-axis and using xlabel ('abc def ghi jkl mno ...') to give them a name. the problem is that the strings don't line up with the index and the length when plotted have gotten longer than the size of the plot. i'm thinking i could rotate the strings at a 45* angle, but i don't know how to do that). hints?
0 个评论
采纳的回答
Prakash S R
2022-5-10
编辑:Prakash S R
2022-5-10
set(gca, 'XTickLabels', {'abc' 'def' 'ghi' 'jkl' 'mno' ..}) ;
xtickangle(45)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!