大数据分析——matplotlib

参考链接:https://blog.csdn.net/xavier_muse/article/details/83859272

fig,ax = plt.subplots()等价于:

  1. fig = plt.figure()

  2. ax = fig.add_subplot(1,1,1)

fig, ax = plt.subplots(1,3),其中参数1和3分别代表子图的行数和列数,一共有 1x3 个子图像。函数返回一个figure图像和子图ax的array列表。

fig, ax = plt.subplots(1,3,1),最后一个参数1代表第一个子图。

如果想要设置子图的宽度和高度可以在函数内加入figsize值

fig, ax = plt.subplots(1,3,figsize=(15,7)),这样就会有1行3个15x7大小的子图。

posted @ 2020-09-30 11:04  cfancy  阅读(136)  评论(0编辑  收藏  举报