You are on page 1of 1

plt.

show()

Rug Plots
1 dimensional representation of a variables distribution
usually used with other plots to enhance visualization

In [ ]: hist_den_rug_plot, ax1 = plt.subplots()

ax1 = sns.distplot(a = df['total_bill'], rug=True)

ax1.set_title('Total Bill Histogram with Density and Rug Plot')

ax1.set_xlabel('Total Bill')

plt.show()

Bar Plots
In [ ]: count_plot, ax1 = plt.subplots()

ax1 = sns.countplot(x='day', data=df)

ax1.set_title('Count of Days')

ax1.set_xlabel('Day of Week')

ax1.set_xlabel('Frequency')

plt.show()

Scatterplot
No scatter function in seaborn , use regplot instead.
plots a scatterpoot and fits a regression line
use fit_reg=False to toggle regression line on/off

In [ ]: scatter_plot, ax1 = plt.subplots()

ax = sns.regplot(x='total_bill', y='tip', data=df)

ax1.set_title('Scatter Plot of Total Bill and Tip')

ax1.set_xlabel('Total Bill')

ax1.set_xlabel('Tip')

plt.show()

Alternative is to use lmplot

lmplot calls regplot

lmplot creates figures , replot creates axes

In [ ]: fig = sns.lmplot(x='total_bill', y='tip', data=df)

plt.show()

Or use jointplot

jointplot creates a scatter that includes a univariate plot on each axis

jointplot does not return axes, so no need to create a figure

jointplot creates a JointGrid object

You might also like