How could I get a smooth curve by "plot" function?

18 ビュー (過去 30 日間)
Jianwei Guo
Jianwei Guo 2012 年 4 月 27 日
コメント済み: Berks 2014 年 12 月 25 日
I find that when I draw a line using plot function, the line is not smooth enough and have jagged edge. I have tried enlarging the data density of points, and still nothing has been improved. So, what should I do to get a smooth curve? Is this just a preference setting problem? Any suggestion will be helpful, and thank you very much.

回答 (3 件)

Jan
Jan 2012 年 4 月 28 日
To insert a picture in a paper I'd suggest the Painters renderer and an export to EPS. While the preview picture e.g. in the screen view of Word looks rough, the lines are smooth when printed to paper or to a PDF.
The suggested export_fig does exactly this also, but with a lot of extra features.
The OpenGL renderer can export pixel images only, while Painters exports vector graphics also.
  1 件のコメント
xueqi
xueqi 2013 年 8 月 29 日
This is really really help. Save the day!!

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


Walter Roberson
Walter Roberson 2012 年 4 月 27 日
There is no preference setting: the smoothness of the curve depends upon the resolution of the data and upon the amount of zooming that one has done.
That said, you may wish to experiment with the three different renderers, and in particular with
set(gcf, 'renderer', 'opengl')
  5 件のコメント
Walter Roberson
Walter Roberson 2012 年 4 月 28 日
You should experiment with using the File Exchange contribution "export_fig".
Walter Roberson
Walter Roberson 2012 年 4 月 28 日
Also, possibly the FEX contribution "plt" would be useful to you.

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


Richard
Richard 2012 年 4 月 27 日
you could use the smoothLine function from the file exchange:
  3 件のコメント
Jan
Jan 2012 年 4 月 28 日
The SmoothLine function modifies the values between the measurement points. In a scientific paper this can be an important error.
Berks
Berks 2014 年 12 月 25 日
There is nothing non-scientific about using SmoothLine. It only changes the interpolation between consecutive points from linear to non-linear - it is an interpolation either way. If you don't want to guess values between points, don't draw a line.

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by