简体   繁体   English

我无法使用 matplotlib.pyplot 和使用 plt.figure(figsize = (10, 12)) 使图表的大小更大

[英]I can't make the size of my graph bigger using matplotlib.pyplot and using plt.figure(figsize = (10, 12))

how can fix this.如何解决这个问题。 my code:我的代码:

plt.plot(kobe.Year, kobe['2P'], label = '2points made')
plt.xlabel('year')
plt.ylabel('2 points made')
plt.title('Kobe Bryant 2points made in his career')
plt.legend(loc = 'best')
plt.figure(figsize = (10, 12))

this does not work这不起作用

You should specify first your plot's size and other arguments such as edge color, style etc. So:您应该首先指定绘图的大小和其他 arguments,例如边缘颜色、样式等。所以:

plt.figure(figsize = (10, 12))   # remove last line and put it here
plt.plot(kobe.Year, kobe['2P'], label = '2points made')
plt.xlabel('year')
plt.ylabel('2 points made')
plt.title('Kobe Bryant 2points made in his career')
plt.legend(loc = 'best')
plt.show()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数字大小不响应我在我的jupyter笔记本中使用matplotlib的plt.figure()中的figsize设置 - figure size does not respond to my figsize setting in plt.figure() with matplotlib in my jupyter notebook 为什么 plt.figure(figsize=(X,y)) 不改变我的 .hist 和 .plot 的大小? - Why isn't plt.figure(figsize=(X,y)) changing the size on my .hist and .plot? 不能“将matplotlib.pyplot导入为plt” - Can't “import matplotlib.pyplot as plt” plt.figure(figsize =(10,20))不起作用 - plt.figure(figsize=(10,20)) is not working 我在使用或导入matplotlib时遇到问题。 这是我的代码的第一行:将matplotlib.pyplot导入为plt - I am having trouble using or importing matplotlib. This is the first line of my code: import matplotlib.pyplot as plt 当列D为True时,如何告诉matplotlib.pyplot使用列A的值制作散点图? - How can I tell matplotlib.pyplot to make a scatter graph using values from Column A when Column D is True? 无法使用`matplotlib.pyplot` 在 jupyter notebook 上打印文本 - Can't print the text on jupyter notebook using `matplotlib.pyplot` 如何使用 matplotlib.pyplot 连接散点 - How can I connect scatter points using matplotlib.pyplot matplotlib-plt.figure()冻结 - matplotlib - plt.figure() freezes Matplotlib:如何在使用plt.figure()和figure.addaxes()时显示图像颜色条 - Matplotlib: how to get image color bar to show up when using plt.figure() and figure.addaxes()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM