Make Parametric Curves Plot Smoother

3 views (last 30 days)
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)

Accepted Answer

Star Strider
Star Strider on 30 Apr 2024
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 Comments
Manuel Santana
Manuel Santana on 30 Apr 2024
Thanks! Switching to a higher resolution monitor fixed the problem.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!