Introduction to Data Visualization with Seaborn
Erin Case
Data Scientist
Two types of relational plots: scatter plots and line plots
Scatter plots
Line plots
import matplotlib.pyplot as plt
import seaborn as sns
sns.relplot(x="hour", y="NO_2_mean",
data=air_df_mean,
kind="scatter")
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.relplot(x="hour", y="NO_2_mean",
data=air_df_mean,
kind="line")
plt.show()
import matplotlib.pyplot as plt import seaborn as sns sns.relplot(x="hour", y="NO_2_mean", data=air_df_loc_mean, kind="line", style="location", hue="location")
plt.show()
import matplotlib.pyplot as plt import seaborn as sns sns.relplot(x="hour", y="NO_2_mean", data=air_df_loc_mean, kind="line", style="location", hue="location", markers=True)
plt.show()
import matplotlib.pyplot as plt import seaborn as sns sns.relplot(x="hour", y="NO_2_mean", data=air_df_loc_mean, kind="line", style="location", hue="location", markers=True, dashes=False)
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.relplot(x="hour", y="NO_2",
data=air_df,
kind="scatter")
plt.show()
import matplotlib.pyplot as plt
import seaborn as sns
sns.relplot(x="hour", y="NO_2",
data=air_df,
kind="line")
plt.show()
Shaded region is the confidence interval
import matplotlib.pyplot as plt import seaborn as sns sns.relplot(x="hour", y="NO_2", data=air_df, kind="line", ci="sd")
plt.show()
import matplotlib.pyplot as plt import seaborn as sns sns.relplot(x="hour", y="NO_2", data=air_df, kind="line", ci=None)
plt.show()
Introduction to Data Visualization with Seaborn