필터 지우기
필터 지우기

Make Parametric Curves Plot Smoother

조회 수: 3 (최근 30일)
Manuel Santana
Manuel Santana 2024년 4월 29일
댓글: Star Strider 2024년 4월 30일
I have an application where I am hoping to plot a region inside a parametric curve, and I need the plot to be fairly close up to the curve, however this seems to have a staircasing effect on the curve. I have plotted an example below which shows the staircasing, (I have increased the line width to help the problem be visible). Is there a way to smooth this out? Refining the discretization doesn't seem to help. I understand that the curve is discrete and won't look perfect, but any suggestions are welcome!
t = linspace(0,2*pi,100);
x =cos(t) + 0.65 * cos(2 * t) -0.65; y = 1.5 * sin(t);
plot(x,y,'Linewidth',1.5)

채택된 답변

Star Strider
Star Strider 2024년 4월 30일
I do not see any problems. The issue you are probably dealing with has to do with the finite resolution of your monitor, and the lines can only be as smooth as your monitor resolution. (Long, long ago in a galaxy far, far away, I once had to write code to plot graphics with a bed plotter with fixed step size, and dealt with this issue. It is definitely not trivial, however recent algorithms are much more efficient than the code I wrote in Applesoft BASIC in 1979 for the plotter.)
  댓글 수: 2
Manuel Santana
Manuel Santana 2024년 4월 30일
Thanks! Switching to a higher resolution monitor fixed the problem.
Star Strider
Star Strider 2024년 4월 30일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by