Histogram Differences Plotly vs Matplotlib

Hi All,

Does anyone knows why histograms have different distributions when plotting in python vs matplotlib even when using the same number of bins in each case?
Note: one of the plots contains a scatter-plot bc i’d like to select outliers and display them on a table.

newplot

Feedback is very appreciated.

tks!

The bin size is clearly not the same on your two example plots.

You also seem to plot different things. The first plot is showing Price returns in $, the other is showing some probability of a return. (How can a return of a product be negative?)

To me it looks like there is something messy about the data you are trying to plot.

You also seem to plot different things. The first plot is showing Price returns in $, the other is showing some probability of a return. (How can a return of a product be negative?)

same bin 30, and i didn’t change labels (i know, a bit sloppy).

  • If you count the bins between 0 and 0.05, the upper plot has 3 bins, the lower has 8. I thoroughly believe something about your bin size is not correct.
  • The reason I belive your are not plotting the same data is if you look at the counts. On the upper plot, the bin just to the right hand side of 0 holds 11 counts, on the lower plot the bins have somewhere between 18 and 12 counts.