Seaborn: [Feature request] show rug below axis or on top to not hide crucial info

Created on 30 Oct 2019  路  2Comments  路  Source: mwaskom/seaborn

When rug=True is specified with distplot the dense placement of the rug lines can hide important info from the histogram or kde depending on the distribution of the data.
For such situations it would be extremely useful to place the rug either below the axis, or on top of the graph or otherwise in a way where it is added instead of overlaid over useful information.

In this example the rug hides the way how the distribution decreases towards close to zero density, but the rug also shows how the long tail is caused by just a few instances with extreme values. It would be very useful to show both, but with the rug not hiding the very important details:
distplot_rug
distplot_norug

Most helpful comment

e.g.

x = np.random.gamma(4, 1, 1000)
ax = sns.distplot(x, kde=False, rug=True)
ax.set_ylim(-.06 * ax.get_ylim()[1])

All 2 comments

You can change the y axis limits to make this work.

e.g.

x = np.random.gamma(4, 1, 1000)
ax = sns.distplot(x, kde=False, rug=True)
ax.set_ylim(-.06 * ax.get_ylim()[1])
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConstantinoSchillebeeckx picture ConstantinoSchillebeeckx  路  4Comments

phantom0301 picture phantom0301  路  3Comments

wenhaosun picture wenhaosun  路  3Comments

bondarevts picture bondarevts  路  3Comments

chanshing picture chanshing  路  3Comments