If I understand right, you want to access the icons
output of the call to legend
and modify the MarkerSize
property of the patch objects that are children of those icons.
Call to legend
:
[h,icons,plots,legend_text] = legend('Circle', 'Plus', 'X', 'Location', 'NorthEast');
icons
is a 6x1 graphics array like so:
icons =
6x1 graphics array:
Text (Circle)
Text (Plus)
Text (X)
Group (Circle)
Group (Plus)
Group (X)
What you need are the elements associated with a Group
.
If you look at their properties (here icons(4)
), you get:
icons(4)
Group (Circle) with properties:
Children: [1x1 Patch]
Visible: 'on'
HitTest: 'off'
Show all properties
So there is a patch object associated with it as its child. You want to modify it using for instance
icons(Some index).Children.MarkerSize
In your case, you need to modify objects 4 to 6:
for k = 4:6
icons(k).Children.MarkerSize = 20;
end
which outputs:
you can automate this of course. I used R2015a so I expect the behavior to be the same for R2014b.
Hope this is what you meant!