Density RugplotΒΆ

Here we demonstrate creating a plot where the first subplot is a distribution of values and the subsequent subplots are rugplots of values for some discrete number of variables

[1]:
import seaborn as sns
import gpplot
[2]:
data = sns.load_dataset('iris')
fig, ax = gpplot.density_rugplot(data, 'petal_length', 'species', ['setosa', 'virginica'])
_images/density_rugplot_3_0.png

We can add a reference line across all plots

[3]:
fig, ax = gpplot.density_rugplot(data, 'petal_length', 'species', ['setosa', 'virginica'], ref_line=5)
_images/density_rugplot_5_0.png

We can change the color and opacity of the rugplot lines

[4]:
fig, ax = gpplot.density_rugplot(data, 'petal_length', 'species', ['setosa', 'virginica'],
                                 density_color='navy', rug_color='skyblue', rug_alpha=1)
_images/density_rugplot_7_0.png

We can pass key word arguments to adjust the line style

[5]:
fig, ax = gpplot.density_rugplot(data, 'petal_length', 'species', ['setosa', 'virginica'], linestyle='dashed', linewidth=2)
_images/density_rugplot_9_0.png
[ ]: