我有一個函數返回一個matplotlib.image.AxesImage對象,我想在同一個圖中並排繪製兩個這些對象。我想是這樣的:在Jupyter筆記本中並排繪製兩個matplotlib.image.AxesImage對象
fig, (ax1, ax2) = plt.subplots(ncols=2)
ax1 = function_that_returns_AxesImage(some_arguments) # tried to reassign ax1
ax2 = function_that_returns_AxesImage(other_arguments) # tried to reassign ax2
然而,這只是側(see current plots output here)產生一個數字與兩個空次要情節和兩個地塊我想繪製在列,而不是側面。 我的問題是,我不得不使用function_that_returns_axes,我不知道如何把返回的情節放入subplots。或者,如果我可以在Jupyter中並排顯示兩個數字,那也可以起作用。
我認爲我們需要對'function_that_returns_axes'的更多信息。它似乎確實考慮了代碼的某些部分,否則它不會繪製到相同的現有數字。這個功能從哪裏來?你自己寫了嗎?你能給它一個鏈接嗎? – ImportanceOfBeingErnest
@ImportanceOfBeingErnest當然,我正在使用galpy庫[https://github.com/jobovy/galpy.git](https://github.com/jobovy/galpy.git)。具體功能是在galpy/galpy/potential_src/Potential.py中找到的繪圖函數。謝謝你的幫助! –
我的答案是否適合你?如果是這樣的話,我不需要深入研究激情代碼。 – ImportanceOfBeingErnest