How to change name of "Others" category for histogram with 'ShowOthers'
1 次查看(过去 30 天)
显示 更早的评论
When using
hh=histogram(C,'ShowOthers','on');
Matlab will create a category "Others". Is there a way to access this name and change it to something else?
0 个评论
采纳的回答
Adam Danz
2019-2-27
编辑:Adam Danz
2019-2-27
Access the axis handle from the histrogram handle ('hh'), then use strrep() to replace the 'Others' in the XTickLabel with whatever you want (here I use "Misc."). Then reassign the new XTickLabel to the axis. You can do that all in 1 line.
hh.Parent.XTickLabel = strrep(hh.Parent.XTickLabel, 'Others', 'Misc.')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!