How to identify what element a handle belongs to
1 次查看(过去 30 天)
显示 更早的评论
I have a vector of handles. Now I'd like to know exactly what handle belongs to what element of the plot.
As a working example,
p = polar ((pi/180) .* [0:45:360], [25 5 25 5 25 5 25 5 25]);
t = findall(gca,'type','text')
h = findall(gca,'type','line')
From 't', i'd like to know which handles belong to the which text elements of the plot. Note that there are more element (length(t) = 20) than x or y labels (I count 17).
From 'h', i'd like to know which handles belong to which elements of the plot. length(h) = 12.
(Matlab R2014a)
2 个评论
Star Strider
2014-6-8
The only problem is that polar is significantly (notoriously) resistant to any modification of most of its properties. It’s not at all like most other graphics objects.
------------------------
I can’t resist commenting on your MRI image. The corpus callosum and limbic tract seem to be abnormally dense. I don’t recall them as such in ‘healthy’ images. (I’m obviously not a Radiologist or Neurologist.)
回答(1 个)
Image Analyst
2014-6-8
The tick mark labels probably also are text objects. Maybe one way is to just set each invisible or visible until you see which vanish or appear when you do that.
3 个评论
Image Analyst
2014-6-8
Of course if you added any text elements, you can get those by
hText = text(x,y, yourString);
But of course there are other "automatic" ones like tick marks. Why do you need to find a specific one?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!