question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shrink parameter in histplot shifts data

See original GitHub issue

The smaller the value of the shrink parameter, the more the values in the histogram get shifted towards positive values.

import seaborn as sns import numpy as np

r = np.random.random(100)

sns.histplot(r);

sns.histplot(r, shrink=0.5);

Screen Shot 2021-02-08 at 10 11 43 PM

Screen Shot 2021-02-08 at 10 15 46 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mwaskomcommented, Feb 10, 2021

Keep in mind that by default the left edge of the first bar aligns with the minimum datapoint and the right edge of the last bar aligns with the maximum datapoint. So if you want to use the bar position to encode the discrete values, you’ll likely want to employ binrange too.

1reaction
mwaskomcommented, Feb 10, 2021

I think that a little shrinking with regularly sampled numeric data can make sense, and should now work. (But not using the discrete= kwarg, which sets bins to be centered on integral values). It does sound like you’ll need to craft your bins= carefully though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

seaborn.histplot — seaborn 0.12.1 documentation - PyData |
If True, fill in the space under the histogram. Only relevant with univariate data. shrinknumber. Scale the width of each bar relative to...
Read more >
Drift & Shift Processing of Data Variation in Volume Production
Analyze drift and shift processing of data variation during volume ... the production setup is correct and/or dial in process parameters.
Read more >
matplotlib.pyplot.hist — Matplotlib 3.1.0 documentation
This parameter can be used to draw a histogram of data that has already been ... If a scalar, the base line for...
Read more >
Histograms in Python - Plotly
import plotly.express as px df = px.data.tips() fig = px.histogram(df, x="total_bill") ... With the histnorm argument, it is also possible to represent the ......
Read more >
How to Make a Seaborn Histogram - Sharp Sight
The data parameter enables you to specify a dataset that you want to plot. This is typically a Pandas dataframe, but the function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found