fig, ax1 = plt.subplots()
left, bottom, width, height = [0.25, 0.6, 0.2, 0.2]
ax2 = fig.add_axes([left, bottom, width, height])
ax1.plot(list(range(10)), color='red')
ax2.plot(list(range(6))[::-1], color='green')
plt.show()
How to add different graphs (as an inset) in another python graph