栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Polar Matplotlib图中的箭头

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Polar Matplotlib图中的箭头

箭头大小太大,这是:

import matplotlibimport numpy as npimport matplotlib.pyplot as pltprint "matplotlib.__version__   = ", matplotlib.__version__print "matplotlib.get_backend() = ", matplotlib.get_backend()# radar green, solid grid linesplt.rc('grid', color='#316931', linewidth=1, linestyle='-')plt.rc('xtick', labelsize=15)plt.rc('ytick', labelsize=15)# force square figure and square axes looks better for polar, IMOwidth, height = matplotlib.rcParams['figure.figsize']size = min(width, height)# make a square figurefig = plt.figure(figsize=(size, size))ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')r = np.arange(0, 3.0, 0.01)theta = 2*np.pi*rax.plot(theta, r, color='#ee8d18', lw=3)ax.set_rmax(2.0)plt.grid(True)ax.set_title("And there was much rejoicing!", fontsize=20)#This is the line I added:arr1 = plt.arrow(0, 0.5, 0, 1, alpha = 0.5, width = 0.015,      edgecolor = 'black', facecolor = 'green', lw = 2, zorder = 5)# arrow at 45 degreearr2 = plt.arrow(45/180.*np.pi, 0.5, 0, 1, alpha = 0.5, width = 0.015,      edgecolor = 'black', facecolor = 'green', lw = 2, zorder = 5)plt.show()

产生:

更好?:)



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/634165.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号