MATLAB Answers

How is the MarkerSize of a 'Circle' marker defined

549 views (last 30 days)
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

Accepted Answer

Daniel Shub
Daniel Shub on 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 Comments

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!