Skip to content

Instantly share code, notes, and snippets.

@ksv-muralidhar
Last active February 16, 2021 12:45
Show Gist options
  • Save ksv-muralidhar/da21d460e190ea288430290380817885 to your computer and use it in GitHub Desktop.
Save ksv-muralidhar/da21d460e190ea288430290380817885 to your computer and use it in GitHub Desktop.
histogram bins
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
fig,ax = plt.subplots(2,3,figsize=(15,10))
row = col = 0
for n,i in enumerate(np.linspace(5,100,6)):
if (n>0) & (n%3==0):
row += 1
col = 0
sns.histplot(x=np.random.randn(100),ax=ax[row,col])
ax[row,col].set_title(f'bins = {int(i)}')
col += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment