MATLAB Answers

1

How is the MarkerSize of a 'Circle' marker defined

Moran Shochat さんによって質問されました 2012 年 7 月 31 日
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 件のコメント

サインイン to comment.

製品

1 件の回答

Daniel Shub
回答者: Daniel Shub
2012 年 7 月 31 日
 採用された回答

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 件のコメント

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

サインイン to comment.



Translated by