如何从Matlab极坐标图中删除Rho标签? [英] How to remove Rho labels from Matlab polar plot?

查看:670
本文介绍了如何从Matlab极坐标图中删除Rho标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Matlab的极坐标图中,我有Theta(0,30,60,..,330)和Rho(20,40,..,100)的默认标签. 我可以使用命令

In my polar plot in Matlab, I have default labels for Theta (0, 30, 60, .., 330) and Rho (20, 40, .., 100). I can remove Theta label using command

set(findall(gca, 'String', '0'),'String', ' ');

请建议如何从图中移除Rho标签(20、40,..,100).

Please advice how to remove Rho labels (20, 40, .., 100) from the figure.

推荐答案

要删除所有标签,只需键入

To remove all labels simply type

delete(findall(gcf,'type','text'));

由于极坐标图标签是放置在图上的隐藏文本对象,因此您不能简单地通过访问轴来找到它们.要仅删除其中一些,您将需要显式地找到包含要删除的特定标签的文本对象.在您的情况下,查找包含Rho的文本对象:

Since the polar plot labels are hidden text objects placed around on the plot, you can not simply find them by accessing axes. To remove only some of them you will need to explicitly find the text objects containing those particular labels you want to delete. In your case, look for text objects containing Rho:

% Get all strings in the hidden labels, choose the ones you want to delete
% Note that some of the labels may contain spaces - you need to be exact.
get(findall(gcf, 'type', 'text'), 'string');

% say your labels have the following strings..
rho_labels = {'20' '40' '60' '80' '100'};
for r=1:length(rho_labels)
    delete(findall(gcf, 'string', rho_labels{r}))
end

这篇关于如何从Matlab极坐标图中删除Rho标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆