第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

帶有twinx()的輔助軸:如何添加到圖例?

帶有twinx()的輔助軸:如何添加到圖例?

湖上湖 2019-08-09 15:33:13
帶有twinx()的輔助軸:如何添加到圖例?我有一個帶有兩個y軸的情節(jié),使用twinx()。我也給線條貼了標(biāo)簽,并希望用它們來展示legend(),但我只是成功地在圖例中獲得了一個軸的標(biāo)簽:import numpy as npimport matplotlib.pyplot as pltfrom matplotlib import rc rc('mathtext', default='regular')fig = plt.figure()ax = fig.add_subplot(111)ax.plot(time, Swdown, '-', label = 'Swdown')ax.plot(time, Rn, '-', label = 'Rn')ax2 = ax.twinx()ax2.plot(time, temp, '-r', label = 'temp')ax.legend(loc=0)ax.grid()ax.set_xlabel("Time (h)")ax.set_ylabel(r"Radiation ($MJ\,m^{-2}\,d^{-1}$)")ax2.set_ylabel(r"Temperature ($^\circ$C)")ax2.set_ylim(0, 35)ax.set_ylim(-20,100)plt.show()所以我只得到圖例中第一個軸的標(biāo)簽,而不是第二個軸的標(biāo)簽“temp”。我怎么能將這第三個標(biāo)簽添加到圖例中?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 474 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號