How to eliminate the jaggedness of the picture drawn by Matlab

14 ビュー (過去 30 日間)
Annie
Annie 2019 年 8 月 9 日
回答済み: Neuropragmatist 2019 年 8 月 9 日
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)
141225_bOhW_817257.jpg
  2 件のコメント
darova
darova 2019 年 8 月 9 日
i use EXPORT_FIG for making beautiful images
Annie
Annie 2019 年 8 月 9 日
Then insert the figure into the word

サインインしてコメントする。

採用された回答

Neuropragmatist
Neuropragmatist 2019 年 8 月 9 日
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 件)

Community Treasure Hunt

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

Start Hunting!

Translated by