-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Fixed handling of shared_axes #1187
Conversation
plot_ranges['y_range'] = plot.y_range | ||
if plot.yaxis[0].axis_label == xlabel: | ||
plot_ranges['x_range'] = plot.y_range | ||
return plot_ranges |
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'm a little confused here...there are only two keys 'x_range' and 'y_range' so if you iterate over a bunch of plots can't you end up clobbering these keys with different values? Won't you end up with whatever was found at the end of the loop?
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.
That is correct, I could have two separate loops for the x- and y-axis and break when a matching axis is found. However in practice if shared_axes
are enabled all the plots will share the same axes anyway so it doesn't much matter whether I end up using the axis from the first or last plot, because they are all the same anyway.
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.
Ok, good that you've thought about this. It is also good to have this pulled out as a method.
Looks good and thanks for adding the unit tests. Merging. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The bokeh backend supports a shared axes option which allows axes with the same axis labels to be linked. The current approach taken here is not quite correct because the plot doesn't remember that an axis is shared so it will simply override extents set by a different plot. Secondly setting
x/yaxis='bare'
will currently disableshared_axes
because it removes the axis label.While this behavior is a lot more consistent, we might want to consider disabling it by default in some cases (e.g. on a simply
Layout
) because it can interfere with axiswise normalization.