大きなプロットの中に小さなプロットを挿入する場合は、hereのようにAxesを使用できます。matplotlibのサブプロット内に小さなプロットを埋め込む
問題は、サブプロット内で同じことを行う方法がわかりません。
私はいくつかのサブプロットを持っており、それぞれのサブプロット内に小さなプロットをプロットしたいと思います。
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
for i in range(4):
ax = fig.add_subplot(2,2,i)
ax.plot(np.arange(11),np.arange(11),'b')
#b = ax.axes([0.7,0.7,0.2,0.2])
#it gives an error, AxesSubplot is not callable
#b = plt.axes([0.7,0.7,0.2,0.2])
#plt.plot(np.arange(3),np.arange(3)+11,'g')
#it plots the small plot in the selected position of the whole figure, not inside the subplot
任意のアイデア: サンプルコードは次のようなものでしょうか?
ありがとうございます!
ソリューションに作業を参照してください[この関連記事](http://stackoverflow.com/questions/14589600/matplotlib-insets-in-subplots) – wflynny
、私は別のを見つけました問題... http://stackoverflow.com/questions/17478165/fig-add-subplot-transform-doesnt-work – Pablo
非常にあなたの両方にありがとうございます。 Billが提案したAxesGridのzoomed_inset_axisと、Pabloの関数を使って、私が探していたことを行うことができました。最後に、すべてのサブプロットで同じサイズのすべての小さな図形をプロットするためにAxesGridよりも面倒であるため、Pabloの関数を使用しています。再度、感謝します! – Argitzen