Matplotlib的用法

来源:互联网 发布:部落冲突详细数据 编辑:程序博客网 时间:2024/06/14 23:08

在做泰坦尼克 数据分析的时候遇到这样的一个函数subplot2grid
下面就简单实现一下关于这个函数的功能

from matplotlib import pyplot as plt

ax1 = plt.subplot2grid((3,3), (0,0), colspan=3)
ax2 = plt.subplot2grid((3,3), (1,0), colspan=2)
ax3 = plt.subplot2grid((3,3), (1, 2), rowspan=2)
ax4 = plt.subplot2grid((3,3), (2, 0))
ax5 = plt.subplot2grid((3,3), (2, 1))
plt.suptitle(“subplot2grid”)
plt.show()

原创粉丝点击