MATLAB Answers

When I plot a curve the lines have little "nicks" in them. How do I fix that?

1 view (last 30 days)
Aaron Schurger
Aaron Schurger on 15 Sep 2020
Edited: KSSV on 15 Sep 2020
Please see the attached plot, and notice the little nicks in the lines. I can't seem to get rid of those. They appear on the screen and also when I export to a graphics file.
Thanks for you help!

  7 Comments

Show 4 older comments
Aaron Schurger
Aaron Schurger on 15 Sep 2020
You can reproduce the problem with one line of code:
plot([-10:0.001:10],normpdf([-10:0.001:10],1,1),'linewidth',7)

Sign in to comment.

Accepted Answer

Vasishta Bhargava
Vasishta Bhargava on 15 Sep 2020
Reduce the linewidth to 2 or 3 You seem to be using 7 which is very thick

  3 Comments

Aaron Schurger
Aaron Schurger on 15 Sep 2020
I want a thick line. That was intentional, and should work on a product that costs as much as Matlab!
But even with a line width of 3, the nicks are still there. Interestingly, when I zoom in on the nick it is no longer there.
Vasishta Bhargava
Vasishta Bhargava on 15 Sep 2020
Use 'painters' in the renderers argument. It might solve the problem
figure
subplot(2,1,1)
set(gcf, 'renderer', 'painters')

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by