Last active
November 18, 2017 04:41
-
-
Save erikaris/6e272800ddfd8f5bf4b9390ea4fc3947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from Coursera | |
import mpl_toolkits.axes_grid1.inset_locator as mpl_il | |
plt.figure() | |
plt.boxplot([ df['normal'], df['random'], df['gamma'] ], whis='range') | |
# overlay axis on top of another | |
# create an inset using .inset_axes() | |
ax2 = mpl_il.inset_axes(plt.gca(), width='60%', height='40%', loc=2) #loc 5 (center right) = loc 7 (right) | |
# fill the axes with a histogram | |
ax2.hist(df['gamma'], bins=100) | |
ax2.margins(x=0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment