circle marker weird filling

13 views (last 30 days)
Herline van der Spuy on 22 Oct 2021
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.
plot(time,strain,'-o','Color',C2,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C2,'MarkerFaceColor',C2);
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.

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 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;
subplot(3,1,1);
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
subplot(3,1,2);
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
subplot(3,1,3);
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)

Image Analyst on 22 Oct 2021
Try a dot
plot(time,strain,'b.-','Color',C2,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C2,'MarkerFaceColor',C2);

Categories

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

R2021a

Community Treasure Hunt

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

Start Hunting!