-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
go.Figure.set_subplots
#2866
go.Figure.set_subplots
#2866
Conversation
Calling `fig.set_subplots(2,3)` works just like fig=make_subplots(2,3). Also accepts the same keywords arguments as make_subplots. Fails if fig already has subplots. Tests still need to be added.
@jonmmease mind taking a quick look here to see if everything makes sense? |
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 looks like a nice addition! One small suggestion on the tests, but otherwise I'm happy with it.
assert fig1.layout == fig1_sp.layout | ||
# Test that calling on a figure that already has subplots throws an error. | ||
raised = False | ||
try: |
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'd recommend using with pytest.raises
(https://docs.pytest.org/en/stable/assert.html#assertions-about-expected-exceptions) here as it's a little more concise.
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.
Originally I used pytest.raisesRegex
but it broke the Python2 tests.
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.
Does the match
argument to pytest.raises
work with Python 2.7? e.g. pytest.raises(ValueError, match=r".* 123 .*")
.
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.
👍
Closes #2405
This is now possible
and
figgy
is equivalent to what is given by:Code PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).