How to find the handle of all markers in plot (already made)?
42 次查看(过去 30 天)
显示 更早的评论
I am learning about plotting in Octave and I wanted to set the marker size of all markers in a plot I already made using plot (using default plot function in Octave 5.1.0 - not sure if it is gnuplot or another one-how to I find this or do I need to specify it to start with?). I want to use the set function to set the marker size, but I need a handle to interact with the markers. Using set(gca,"markersize",16) for instance gives an error that the property "markersize" doesn't exist.
The markers I'm using (no lines) are all different styles like "x","o","+",etc and colors. I was able to get the handle of one style using h=findobj(gca,"marker","x"), and then set the "x" marker size from there. However, I don't know how to do this for all makrers. I have also tried h=findall(gca,"type","marker") to no avail.
How do I set the marker size of all markers at once? Also, is there a list of all object types? The Matlab help pages for findobj and findall only listed a few types of objects in the examples.
I also have a couple of general questions if you don't mind answering (or pointing me to a good resource to learn from): What does it mean when it displays the handle is equal to a number (e.g. h=findobj(...) then Octave displays h=-29.776)? What is the difference between gca and gcf?
0 个评论
采纳的回答
darova
2019-11-11
To set up markerSize to every marker try:
h = get(gca,'children');
for i = 1:length(h)
if strcmp(get(h(i),'type'),'line') % check if it's a line
set(h(i),'markersize',10);
end
end
Yellow is gcf - figure
Green is gca - axes
set(gcf,'color','y')
set(gca,'color','g')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!