Skip to content Skip to sidebar Skip to footer

Is It Possible To Do A "zoom Inset" Using Seaborn?

This example from matplotlib shows how to do an inset. However I am working with seaborn, specifically the kdeplot. sns.kdeplot(y, label='default bw') sns.kdeplot(y, bw=0.5, label

Solution 1:

seaborn is just a wrapper around matplotlib, you do not have to chose one or the other. In your case, you can instruct sns.distplot() to use whathever Axes object you want using the ax= parameter

Therefore:

fig, ax = plt.subplots()
sns.distplot(d, ax=ax)

ax2 = plt.axes([0.2, 0.6, .2, .2], facecolor='y')
sns.distplot(d, ax=ax2)
ax2.set_title('zoom')
ax2.set_xlim([0.9,1.])

enter image description here

Post a Comment for "Is It Possible To Do A "zoom Inset" Using Seaborn?"