ProE常用曲线方程:Python Matplotlib 版本代码(玫瑰曲线)
2017-12-27 17:31
661 查看
Pyplot教程:https://matplotlib.org/gallery/index.html#pyplots-examples
玫瑰曲线
文字描述
平面内,围绕某一中心点平均分布整数个正弦花瓣的曲线.数学描述
在极坐标下可表示为ρ=a*sin(nθ),a为定长,n为整数.图形描述
在极坐标系中,以下方程表示的曲线称为玫瑰曲线:r = sin ( k θ ) 或 r = cos ( k θ )
当 k 是奇数时,玫瑰曲线有 k 个花瓣;当 k 是偶数时,玫瑰曲线有 2k 个花瓣。执行效果如下图:
Python代码:
def drawFlowers(): theta=np.arange(0,2*np.pi,0.02); plt.subplot(111,polar=True); plt.plot(theta,np.cos(6*theta),'-',lw=2);#6瓣花瓣 plt.plot(theta,np.cos(5*theta),'--',lw=2);#5瓣花瓣 plt.plot(theta,2*np.cos(4*theta),lw=2);#4瓣花瓣 plt.rgrids(np.arange(0.5,2,0.5),angle=45); plt.thetagrids([0,45,90]); plt.show();
玫瑰曲线:
相关文章推荐
- ProE常用曲线方程:Python Matplotlib 版本代码(蝴蝶曲线)
- ProE复杂曲线方程:Python Matplotlib 版本代码(L系统,吸引子和分形)
- 机器学习实战python版本matplotlib安装遇到的各种问题和代码演示
- pyqt中使用matplotlib绘制动态曲线 – pythonic
- python matplotlib中常用函数
- 不同版本中Python matplotlib.pyplot.draw()界面绘制异常问题的解决
- 在Windows 系统安装基于Python3.5 版本的Matplotlib库
- Python开发环境Wing IDE matplotlib 2D绘图库代码调试技巧
- python+matplotlib绘制3D条形图实例代码
- Matplotlib常用画图代码
- Python数据分析与挖掘实战(Pandas,Matplotlib常用方法)
- python+matplotlib绘制饼图散点图实例代码
- Python+matplotlib实现华丽的文本框演示代码
- python及常用库numpy、scipy、matplotlib安装与卸载-Windows环境
- python中引用matplotlib画图的几个常用命令及基本步骤
- Python 中利用 matplotlib 进行曲线的部分填充 fill_betweenx
- python matplotlib 绘制双Y轴曲线图
- python 安装matplotlib后运行图表时提示错误numpy版本不对的解决方法
- Python中常用模块re,matplotlib,pandas,sys,mysql
- 【python数据挖掘课程】十.Pandas、Matplotlib、PCA绘图实用代码补充