How is the MarkerSize of a 'Circle' marker defined

262 Ansichten (letzte 30 Tage)
Moran Shochat
Moran Shochat am 31 Jul. 2012
Hi,
I'm ploting a 'Circle' marker using the 'plot' command. I'm setting the marker size using 'MarkerSize' property. e.g.:
plot(x,y,'or','MarkerSize',10);
Figure 'Units' are 'pixels'.
My question is what does the number 10 means (in pixles)? I played with it and it is not the radius or diameter in pixels. Any suggestions?
Thanks, Moran

Akzeptierte Antwort

Daniel Shub
Daniel Shub am 31 Jul. 2012
The circle marker size appears to be the number of points in the diameter. For the other markers, it is not so clear. You can create a square axis with x and y limits of -1 to 1 that is scale inches high and wide
scale = 4;
set(gca, 'Units', 'Inches')
set(gca, 'Position', scale*[0.25, 0.25, 1, 1])
set(gca, 'YTickLabel', [])
set(gca, 'XTickLabel', [])
axis([-1, 1, -1, 1])
axis square
box on
hold on
and then plot all the symbols to be scale*72 units big. I chose 72 since there are 72 points in an inch.
plot(0 , 0, '.', 'MarkerSize', scale*72);
plot(0 , 0, 'o', 'MarkerSize', scale*72);
plot(0 , 0, 'x', 'MarkerSize', scale*72);
plot(0 , 0, '+', 'MarkerSize', scale*72);
plot(0 , 0, '*', 'MarkerSize', scale*72);
plot(0 , 0, 's', 'MarkerSize', scale*72);
plot(0 , 0, 'd', 'MarkerSize', scale*72);
plot(0 , 0, 'v', 'MarkerSize', scale*72);
plot(0 , 0, '^', 'MarkerSize', scale*72);
plot(0 , 0, '<', 'MarkerSize', scale*72);
plot(0 , 0, '>', 'MarkerSize', scale*72);
plot(0 , 0, 'p', 'MarkerSize', scale*72);
plot(0 , 0, 'h', 'MarkerSize', scale*72);
  4 Kommentare
Daniel Shub
Daniel Shub am 31 Jul. 2012
@Moran you need to watch your terminology. I set the units of the AXIS and not the FIGURE. Neither of which are the OBJECT. Some OBJECTs have a UNITS property, and others do not. In the case of OBJECTs of type LINE, which markers are, there is no UNITS property.
Moran Shochat
Moran Shochat am 31 Jul. 2012
Thank you Daniel, that was helpful.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by