Make Parametric Curves Plot Smoother
3 次查看(过去 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)
0 个评论
采纳的回答
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.)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!