饼图标签重叠
80(30天)
显示旧的评论
接受的答案
亚当Danz
2020年4月28日
编辑:亚当Danz
2020年4月29日
使用
派()
输出处理获取文本对象。
h =派(。);
th = findobj (h,“类型”,“文本”);%的文本处理
确定哪些文本字符串开头" < "
小= startsWith ({th.String},“<”);% r2016b或晚
%小= ~ cellfun (@isempty regexp ({th.String}, ' ^ < '));%任何matlab版本
删除文本对象或取代他们与空字符串值。
删除(th(小));
%或
集(th(小),“字符串”,”)
演示:
h =派(排序([linspace (0, 1, 20), linspace (5、2、10), linspace (1、10、20))));
答案(1)
托托
2020年4月28日
编辑:托托
2020年4月28日
下面的饼图的文档标签
//www.tatmou.com/help/matlab/creating_plots/customize-pie-chart-labels.html
,我们可以把标签。一个简单的for循环可以删除你不想要的。
x = 50 50 [0.1];
p =饼(x);
pText = findobj (p,“类型”,“文本”);
为i = 1:长度(x)
如果比较字符串(pText .String(我),“< 1%”)
pText(我)。字符串=”;
结束
结束