Created
September 2, 2021 04:21
-
-
Save yucongo/ae422de0b4f64d4ecf6f97497f654865 to your computer and use it in GitHub Desktop.
plot with axes
This file contains 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
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
%matplotlib inline | |
df = pd.read_csv('environment_bra.csv') | |
df.head() |
This file contains 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
# https://dev.to/thalesbruno/subplotting-with-matplotlib-and-seaborn-5ei8 | |
import pandas as pd | |
import seaborn as sns | |
from matplotlib import pyplot as plt | |
sns.set() # Setting seaborn as default style even if use only matplotlib | |
# df = pd.read_csv(...) | |
fig, axes = plt.subplots(2, 3, figsize=(18, 10)) | |
fig.suptitle('Pokemon Stats by Generation') | |
sns.boxplot(ax=axes[0, 0], data=pokemon, x='Generation', y='Attack') | |
sns.boxplot(ax=axes[0, 1], data=pokemon, x='Generation', y='Defense') | |
sns.boxplot(ax=axes[0, 2], data=pokemon, x='Generation', y='Speed') | |
sns.boxplot(ax=axes[1, 0], data=pokemon, x='Generation', y='Sp. Atk') | |
sns.boxplot(ax=axes[1, 1], data=pokemon, x='Generation', y='Sp. Def') | |
sns.boxplot(ax=axes[1, 2], data=pokemon, x='Generation', y='HP') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment