微信扫一扫打赏支持
上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 498 下一页
摘要: matplotlib_200730系列 13、次坐标轴 一、总结 一句话总结: I、ax2=axl.twinx(); #Create a twin Axes sharing the xaxis II、axl.plot(x,y1,'g-'); ax2.plot(x,y2,'b--'); import 阅读全文
posted @ 2020-07-31 05:21 范仁义 阅读(153) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 12、图中图 一、总结 一句话总结: 主要是改变axis的位置:ax1=fig.add_axes([left,bottom,width,height]) # 小图1(主要是改变 left,bottom,width,height) left,bottom,wid 阅读全文
posted @ 2020-07-31 04:54 范仁义 阅读(326) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 11、Subplot 分格显示 一、总结 一句话总结: method 1:subplot2grid:axl=plt.subplot2grid((3,4),(0,0),colspan=4,rowspan=1) method 2:gridspec:gs=grids 阅读全文
posted @ 2020-07-31 03:29 范仁义 阅读(219) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 10、Subplot 多合一显示 一、总结 一句话总结: plt.subplot(2,2,1):分成2行2列,第1个图:也可以写成 plt.subplot(221) import matplotlib.pyplot as plt plt.figure() # 阅读全文
posted @ 2020-07-30 23:11 范仁义 阅读(138) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 9、3D数据 一、总结 一句话总结: 画3D图:ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=plt.get_cmap('rainbow')) 画等高线图:ax.contourf(X,Y,Z,zdir='z',o 阅读全文
posted @ 2020-07-30 22:51 范仁义 阅读(101) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 8、image图片 一、总结 一句话总结: plt.imshow(data) 将数值转成颜色 plt.colorbar() 显示颜色基准条 data=np.random.uniform(0,1.0,9).reshape((3,3)) # plt.imshow( 阅读全文
posted @ 2020-07-30 22:27 范仁义 阅读(87) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 7、contours 等高线图 一、总结 一句话总结: A、将点放到网格(meshgrid)上面去:X,Y=np.meshgrid(x,y) B、填色:plt.contourf(X,Y,f(X,Y),8, alpha=0.75, cmap=plt.cm.hot 阅读全文
posted @ 2020-07-30 06:35 范仁义 阅读(169) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 6、Bar 柱状图 一、总结 一句话总结: 柱状图使用非常简单,就是bar方法:plt.bar(X,+Y1,facecolor="#9999ff",edgecolor="white") plt.bar(X,+Y1,facecolor="#9999ff",edg 阅读全文
posted @ 2020-07-30 05:54 范仁义 阅读(190) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 5、Annotation标注 一、总结 一句话总结: 1、plt的annotate方法添加标注,plt的text方法添加文本标注 2、虚线用plot方法画,scatter方法来标注点 # 添加标注 # 1、画虚线,也就是两个点 x0=1 y0=2*x0+1 # 阅读全文
posted @ 2020-07-30 05:01 范仁义 阅读(124) 评论(0) 推荐(0)
摘要: matplotlib_200730系列 4、legend图例 一、总结 一句话总结: 画线中加label表示线的名字,调用legend方法即可显示图例 import matplotlib.pyplot as plt import numpy as np x=np.linspace(-3,3,50) 阅读全文
posted @ 2020-07-30 03:22 范仁义 阅读(113) 评论(0) 推荐(0)
上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 498 下一页