当前位置 博文首页 > plt.figure()参数使用详解及运行演示
(1)figure语法说明
(2)例子:
import matplotlib.pyplot as plt
创建自定义图像
fig=plt.figure(figsize=(4,3),facecolor=‘blue') plt.show()
(1) subplot语法
subplot(nrows,ncols,sharex,sharey,subplot_kw,**fig_kw)
代码运行及演示
plt.figure(figsize=(6,8))
表示figure 的大小为宽、长(单位为inch)
figsize : (float, float), optional, default: None
width, height in inches. If not provided, defaults to
rcParams[“figure.figsize”] = [6.4, 4.8].
plt.subplot(121)
表示整个figure分成1行2列,共2个子图,这里子图在第一行第一列
plt.subplot(122)
表示子图在第一行第二列
到此这篇关于plt.figure()参数使用详解及运行演示的文章就介绍到这了,更多相关plt.figure()参数内容请搜索站长博客以前的文章或继续浏览下面的相关文章希望大家以后多多支持站长博客!
js