So the question is:
Can I plot a histogram in Plotly, where all values that are bigger than some threshold will be grouped into one bin?
The desired output:
But using standard plotly Histogram class I was able only to get this output:
import pandas as pd
from plotly import graph_objs as go
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode()
test_df = pd.DataFrame({'values': [1]*10 + [2]*9 +
[3.1]*4 + [3.6]*4 +
[4]*7 + [5]*6 + [6]*5 + [7]*4 + [8]*3 +
[9]*2 + [10]*1 +
[111.2]*2 + [222.3]*2 + [333.4]*1}) # <- I want to group them into one bin "> 10"
data = [go.Histogram(x=test_df['values'],
xbins=dict(
start=0,
end=11,
size=1
),
autobinx = False)]
layout = go.Layout(
title='values'
)
fig = go.Figure(data=data, layout=layout)
iplot(fig, filename='basic histogram')


