How to eliminate the jaggedness of the picture drawn by Matlab
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Annie
am 9 Aug. 2019
Beantwortet: Neuropragmatist
am 9 Aug. 2019
How to eliminate the jaggedness of the picture drawn by Matlab ?
As shown in the figure, the points have been taken more, and more or not smooth. The jaggedness is very serious, and the relevant options are not found in the document. How to solve it?
x=0:0.001:2*pi;
plot(x)

Akzeptierte Antwort
Neuropragmatist
am 9 Aug. 2019
The jaggedness is called aliasing and it happens when in image, shape or function is downsampled, for instance when an exact function like sin(x) is shown at 100x100 pixel resolution.
If you want to save figures without aliasing you could use export_fig as darova suggested but I find it overrated. You would probably be able to solve the problem by just saving the figure with a higher resolution, like this:
x = 0:0.01:2.*pi;
y = sin(x);
figure
plot(x,y)
print('lots_of_aliasing.png','-dpng','-r80')
print('less_aliasing.png','-dpng','-r200')
However, in your question you show a plot inside an open Matlab figure window rather than a saved file. If you want to reduce aliasing in matlab figure windows I don't know if that's really possible. It would depend on your graphics hardware+software and probably the resolution of the monitor you view it on, you could check out these threads and maybe there is some gold to be had there:
Hope this helps,
M.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!