Skip to content
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

Merged
merged 2 commits into from
Mar 10, 2017
Merged

Fixed handling of shared_axes #1187

merged 2 commits into from
Mar 10, 2017

Conversation

philippjfr
Copy link
Member

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 disable shared_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.

@philippjfr philippjfr added tag: backend: bokeh type: bug Something isn't correct or isn't working labels Mar 10, 2017
plot_ranges['y_range'] = plot.y_range
if plot.yaxis[0].axis_label == xlabel:
plot_ranges['x_range'] = plot.y_range
return plot_ranges
Copy link
Contributor

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?

Copy link
Member Author

@philippjfr philippjfr Mar 10, 2017

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.

Copy link
Contributor

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.

@jlstevens
Copy link
Contributor

Looks good and thanks for adding the unit tests.

Merging.

@jlstevens jlstevens merged commit 51d4b09 into master Mar 10, 2017
@philippjfr philippjfr deleted the shared_axes branch April 19, 2017 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: backend: bokeh type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants