How to use filled circles (dots) instead of empty circles in scatter plots?
Mostrar comentarios más antiguos
How to use filled circles (dots) instead of empty circles in scatter plots?
Respuestas (1)
Thorsten
el 26 de Mayo de 2015
scatter(rand(1,10), rand(1,10), 'o', 'MarkerFaceColor', 'b')
5 comentarios
Mike Garrity
el 26 de Mayo de 2015
That's right, and there's a shortcut for it too.
scatter(rand(1,10), rand(1,10), 'filled')
Mr M.
el 26 de Mayo de 2015
Star Strider
el 26 de Mayo de 2015
Editada: Star Strider
el 26 de Mayo de 2015
The units are whatever the default units are.
Ask for them:
u = get(groot, 'defaultFigureUnits') % >= R2014b
u = get(0, 'defaultFigureUnits')
The second will currently work in all versions.
The default marker size is:
ms = get(0, 'defaultLineMarkerSize')
To get a list of all the properties you want or might want to change, do:
f = get(0, 'factory')
Joseph Cheng
el 26 de Mayo de 2015
the units and marker sizes are explained very well here http://www.mathworks.com/matlabcentral/answers/44917-how-is-the-markersize-of-a-circle-marker-defined
Mike Garrity
el 27 de Mayo de 2015
The markers in scatter actually don't follow quite the same rules as the ones on the other objects.
For scatter, the units are always points squared. That means that (if your monitor is calibrated correctly) the following will produce markers which are 1 inch in diameter.
scatter(1:10, 1:10, 5184)
That's because there are 72 points in an inch, and 5,184 is 72^2.
The reason that scatter is special is because the size of the marker is representing data, rather than just being cosmetic. For that reason it was decided that it should scale with the area and not be sensitive to units.
However, as the thread Joseph referred to shows, the actual markers don't all agree on what the diameter means. This was a cosmetic adjustment that was originally done to make lines with different markers look good together when the MarkerSize properties were the same. But since scatter uses the same marker styles, it inherits this odd quirk that makes the sizing less predictable than it should be.
Categorías
Más información sobre Scatter Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!