Skip to content

Add update functionality to make_subplots #221

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

Closed
etpinard opened this issue May 25, 2015 · 4 comments
Closed

Add update functionality to make_subplots #221

etpinard opened this issue May 25, 2015 · 4 comments
Milestone

Comments

@etpinard
Copy link
Contributor

@theengineear @chriddyp

So that axes can be generated with custom attributes.

Perhaps like

tls.make_subplots(rows=4, cols=3, update_xaxes=dict(), update_yaxes=dict())

and/or

tls.make_subplots(rows=2, cols=2, specs=[[{update_xaxis=dict(), update_yaxis=dict()}, {}], [{}, {}]])

more info here.

@chriddyp
Copy link
Member

I recall that we thought about adding an axes object or attribute to Figure and Layout to put axes into lists: #170 (comment)

which would allow easier:

for axis in Figure.axes:
  axis['showgrid'] = False

adding @aneda @cldougl

@etpinard
Copy link
Contributor Author

@chriddyp

The for axis in Figure.axes pattern works great when looping over all axes, but not so much when pinpointing one axis or a handful of axes among all axes - as presented in this stack overflow Q.

@theengineear
Copy link
Contributor

I still think that we're making a micro-language of the make_subplots call. I just feel like you need to (1) understand plotly json syntax and now (2) understand all of make_subplots to grok this code. That said, it's clearly a need if we're getting SO hits on it.

@etpinard the second method you suggest covers the user's needs, so I'd vote for that, even if it's a little more verbose.

Could we do something like this (and maybe this is what you were getting at with the first approach)?

tls.make_subplots(rows=2, cols=2, axes_updates=[
    {'target_axis': 'x', 'row': 1, 'col': 2, 'update': {'title': 'blah'},
    {'target_axis': 'all', 'row': 1, 'col': 2, 'update': {'type': 'log'}
])

That feels more readable to me. But maybe it's (1) not possible given how the code works or (2) working outside the specs system when we don't have to.

(2) cents : D

@theengineear theengineear added this to the 1.7 Release milestone Jun 15, 2015
@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants