Plots Flashcards
1
Q
Density Plot
A
import seaborn as sns
sns.kdeplot(x=df.x, y=df.y, cmap=”Blues”, shade=True)
2
Q
Hexbin Plot
A
df.plot(kind=’hexbin’, x=’x’, y=’y’, gridsize = 13)
3
Q
Scatterplot
A
df.plot(kind=’scatter’,x=’x’, y=’y’)
OR
sns.scatterplot(x=’x’, y=’y’, data=data)
4
Q
Bar plot
A
import plotly.express as px
fig = px.bar(df, x=”Year”, y=”Population”, color=”Country”)
fig.update_layout(barmode=’group’)
fig.show()
df.plot.bar(“Month”, “Value”);
5
Q
Dot plot
A
fig = px.scatter(df, x=”Year”, y=”Population”, color=”Country”)
fig.show()
6
Q
Line plot
A
df.plot.line(“Month”, “Value”)
7
Q
Waterfall chart
A
!pip install waterfallcharts
import waterfall_chart
waterfall_chart.plot(df.Month, df.Delta)
8
Q
Histogram
A
plt.hist(data[‘column’], bins=20)