How to find the handle of all markers in plot (already made)?
66 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
aweller3
el 10 de Nov. de 2019
Comentada: aweller3
el 11 de Nov. de 2019
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 comentarios
Respuesta aceptada
darova
el 11 de Nov. de 2019
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')
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Object Identification en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!