簡體   English   中英

半屏上的Python圖形圖

[英]Python figure plots on half screen

我有以下代碼,並且很難在整個屏幕上顯示該圖。

fig = plt.figure()
fig.subplots_adjust(bottom=0.2)
ax1 = fig.add_subplot(212)
ax1.set_xlabel('Time')
ax1.set_ylim(0,time)
line1 = ax1.plot(a,'bo-',label='One')
line2 = ax1.plot(b,'mo-',label='Two')
lines = line1 + line2
labels = [l.get_label() for l in lines]
ax1.legend(lines, labels, loc=(0,-0.5), ncol=2)
plt.show()

我嘗試了所有在網絡上找到的答案以及線程python圖擴展到全屏的所有建議,但都沒有用。

任何幫助,將不勝感激!

PS我不使用

t = np.arange(b)
plt.plot(t, a, 'bo-')

例如,因為如果x和y的值不同,則無法使用,並且由於程序的不同,我無法預定義x。

ax1 = fig.add_subplot(212)

創建一個2x1圖,並返回第二個子圖。 如果只需要一個圖,請將此線更改為

ax1 = fig.add_subplot(111)

1x1分割返回單個子圖。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM