MATLAB Answers

1

How is the MarkerSize of a 'Circle' marker defined

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

  0 Comments

Sign in to comment.

Products

1 Answer

Answer by Daniel Shub
on 31 Jul 2012
 Accepted Answer

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 Comments

Show 1 older comment
Jan
on 31 Jul 2012
@Moran: A small experiment on your computer will answer this question already. Why asking in the forum, what can be investigated locally?
@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.
Thank you Daniel, that was helpful.

Sign in to comment.