问题
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', ' ');
Please advice how to remove Rho labels (20, 40, .., 100) from the figure.
回答1:
To remove all labels simply type
delete(findall(gcf,'type','text'));
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
来源:https://stackoverflow.com/questions/12581008/how-to-remove-rho-labels-from-matlab-polar-plot