circle marker weird filling

13 views (last 30 days)
The circle marker is doing something weird. How can I fix this? Is it the edge thing or the order or what? How do I 'smooth' the edges? Is it because it is filled? It doesn't do it when it's not 'filled'? C2 is an RGB colour code.
Herline van der Spuy
Herline van der Spuy on 26 Oct 2021
Luckily, the figure is scale down a bit. And you can't see the difference on the pdf. So that's okay. But thank you for the help.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Oct 2021
Linewidth problems. The circle is drawn as a series of straight segments and when the Linewidth is not 1 the ends of the lines extend out in a way that leaves the shape non-circular. The line segments are constant width, not feathered taking into account the line width.
Kelly Kearney
Kelly Kearney on 22 Oct 2021
You can play around with layering separate line and marker objects to get a more aesthetically pleasing look:
lw = 5;
mksz = 8;
plot(1:10, 1:10, '-bo', 'markersize', mksz, 'linewidth', lw, 'markeredgecolor', 'b', 'markerfacecolor', 'r');
% If you want a linewidth around the markers comparable to the line, layer
% edgeless markers of different sizes
plot(1:10, 1:10, '-bo', 'markersize', mksz+lw, 'linewidth', lw, 'markeredgecolor', 'none', 'markerfacecolor', 'b');
hold on;
plot(1:10, 1:10, 'o', 'markersize', mksz-lw/2, 'markeredgecolor', 'none', 'markerfacecolor', 'r');
% If you're okay with a thinner marker outline, you can use markers with a
% different line width
plot(1:10, 1:10, '-b', 'linewidth', lw);
hold on;
plot(1:10, 1:10, 'o', 'markersize', mksz, 'linewidth', 1, 'markeredgecolor', 'b', 'markerfacecolor', 'r');
(Note: the auto-generated Answers image is pretty low-res... it looks better when run in actual Matlab)

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 22 Oct 2021
Try a dot


Find more on 2-D and 3-D Plots in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!