How to display smooth (high definition) curves with plot?
조회 수: 4 (최근 30일)
이전 댓글 표시
This question concerns only the way a curve is displayed on the screen with plot(x,y), not the data. For example:
x=linspace(0,50,1000000);
plot(x,sin(x))
Displays the following plot:

And I would like to have something like this:

Notice that in the second graph, the curve is much smoother. The amount of data points is not the problem here, since we have 1000000 (one million) points. Also, I'm looking for a way to display it, not to export into an image file since after plotting it, I use getframe to copy the figure displayed and create a movie.
I have tried setting the figure property Renderer to painters, zbuffer and OpenGL, and none of them work.
Thank you
댓글 수: 0
채택된 답변
Jan
2017년 3월 7일
편집: Jan
2017년 3월 7일
A million data points is very much for this tiny image, which does not have 1 million pixels.
Please try (i cannot do this currently):
x = linspace(0, 50, 1000);
plot(x, sin(x), 'LineSmoothing', 'on');
If this does not work, there might be a problem with the OpenGL renderer. See https://www.mathworks.com/matlabcentral/answers/157696-line-smoothing-in-matlab2014b.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!