-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bingroup #200
bingroup #200
Conversation
|
||
fig.show() | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be interesting to show the behaviour with and without bingroup
, for example
import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(2,2)
fig.add_trace(go.Histogram2d(
x = [ 1, 2, 2, 3, 4 ],
y = [ 1, 2, 2, 3, 4 ],
#bingroup = 1,
xbins = {'start':1, 'size':1}), 1,1)
fig.add_trace(go.Histogram2d(
x = [ 4, 5, 5, 5, 6 ],
y = [ 4, 5, 5, 5, 6 ],
#bingroup = 1,
ybins = {'start': 3, 'size': 1}),1,2)
fig.add_trace(go.Histogram2d(
x = [ 1, 2, 2, 3, 4 ],
y = [ 1, 2, 2, 3, 4 ],
bingroup = 1,
xbins = {'start':1, 'size':1}), 2,1)
fig.add_trace(go.Histogram2d(
x = [ 4, 5, 5, 5, 6 ],
y = [ 4, 5, 5, 5, 6 ],
bingroup = 1,
ybins = {'start': 3, 'size': 1}),2,2)
fig.show()
python/2D-Histogram.md
Outdated
@@ -71,6 +71,30 @@ fig = go.Figure(go.Histogram2d(x=x, y=y, histnorm='probability', | |||
fig.show() | |||
``` | |||
|
|||
### 2D Histogram Share Binning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing bin settings between 2D Histograms
python/histograms.md
Outdated
@@ -331,6 +331,28 @@ fig.append_trace(trace5, 3, 2) | |||
fig.show() | |||
``` | |||
|
|||
### Share Binning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Share bins between histograms
python/histograms.md
Outdated
@@ -331,6 +331,28 @@ fig.append_trace(trace5, 3, 2) | |||
fig.show() | |||
``` | |||
|
|||
### Share Binning | |||
In this example both histograms have a compatible bin settings using [bingroup](https://plot.ly/python/reference/#histogram-bingroup) attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add here a comment saying that histograms in the same subplot are forced into the same default to barmode stack, relative or group, but not for overlay?
python/histograms.md
Outdated
) | ||
trace4 = go.Histogram(x=x, | ||
trace4 = go.Histogram(x=x,bingroup=1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you define here a bingroup
since the different traces have a different bin size. Also, please remove all the autobinx
and autobiny
from this tutorial since these parameters are described as obsolete in the doc.
Thanks @Mahdis-z I left a couple of comments. |
fig.add_trace(go.Histogram2d( | ||
x = [ 1, 2, 2, 3, 4 ], | ||
y = [ 1, 2, 2, 3, 4 ], | ||
#bingroup = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the commented lines, it was just me doing some trial and error but these should not appear
@@ -331,6 +327,28 @@ fig.append_trace(trace5, 3, 2) | |||
fig.show() | |||
``` | |||
|
|||
### Share bins between histograms | |||
In this example both histograms have a compatible bin settings using [bingroup](https://plot.ly/python/reference/#histogram-bingroup) attribute. Note that traces on the same subplot, and with the same `barmode` ("stack", "relative", "group") are forced into the same `bingroup`, however traces with `barmode = "overlay"` and on different axes (of the same axis type) can have compatible bin settings. Histogram and [histogram2d](https://plot.ly/python/2D-Histogram/) trace can share the same `bingroup`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence was not completely clear to me, I would say "however traces with barmode = "overlay"
or on different axes can different bin settings".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see plotly/plotly.js#3515 (comment) for a better understanding of what compatible
means here.
💃 once two very minor comments are addressed (no need to review again) |
Can we port this PR to the plotly.py repo please? :) |
No description provided.