Skip to content

Instantly share code, notes, and snippets.

@yucongo
Created September 2, 2021 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yucongo/ae422de0b4f64d4ecf6f97497f654865 to your computer and use it in GitHub Desktop.
Save yucongo/ae422de0b4f64d4ecf6f97497f654865 to your computer and use it in GitHub Desktop.
plot with axes
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
df = pd.read_csv('environment_bra.csv')
df.head()
# 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