Created
January 3, 2022 07:12
-
-
Save kshirsagarsiddharth/cfeb4cf12156ab7bb7371d4fbf97ff31 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
| def plot_histogram(bins = 10, hue = 'categories', kde = False, palette = 'Blues', x_range_1 = (-3,3)): | |
| """plots histogram | |
| params: | |
| ======= | |
| bins: int | |
| histogram bins | |
| hue: str | |
| categorical columns to color | |
| kde: bool | |
| wether to show kde plot | |
| palette: str | |
| palette of histogram | |
| x_range_1: tuple(int,int) | |
| x range of the plot | |
| returns: | |
| histogram | |
| """ | |
| plt.figure(dpi = 120) | |
| sns.histplot(data = sample_df, | |
| x = 'values', | |
| palette=palette, | |
| bins = bins, | |
| hue = hue, | |
| kde = kde, | |
| ) | |
| plt.xlim(x_range_1) | |
| plot_histogram() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment