How to remove artifacts in plots?
Show older comments
The following code is an example that represents my problem:
x=0:1:100;
y=zeros(size(x));
y(1:10)=10:-1:1;
y(13:2:99)=1e-15;
plot(x,y);
Unexpectedly the plot doesn't show a straight line for x values higher than 10. The plot suggests that the 'bumps' are much higher than 1e-15, since 1e-15 shouldn't be visible when using this y axis. However, if I use the Pan tool and move the line a very tiny bit upwards, then it suddenly becomes straight.
As a temporary work-around I round all y values before making plots, but I think that shouldn't be necessary.
How can I remove the artifacts without having to round the y values?
2 Comments
Azzi Abdelmalek
on 22 Jun 2015
I am not following you, what is exactly your problem?
Adrie
on 22 Jun 2015
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



