Repository navigation
BUG: pass ax parameter through to dot_plot in CombineResults.plot_forest - #9829
Conversation
Aniketsy
left a comment
There was a problem hiding this comment.
thanks for the PR, looks good 👍
one suggestion, i think we can move this import matplotlib.pyplot as plt at top level
|
Done. Thanks for the review. |
| import matplotlib.pyplot as plt | ||
| fig, ax = plt.subplots() | ||
| fig_out = res1.plot_forest(ax=ax, use_t=False) | ||
| assert fig_out is fig |
There was a problem hiding this comment.
Need to check that ax has changed. Could just check that len(ax.get_children()) has changed between the init and the call.
There was a problem hiding this comment.
I added the tests so this can move forward.
|
|
||
| import io | ||
|
|
||
| import matplotlib.pyplot as plt |
There was a problem hiding this comment.
We never add mpl outside if functions because it is an optional dependency.
There was a problem hiding this comment.
thanks for the clarification, apologize @EdenRochmanSharabi 😿 for my previous suggestion of moving at top level
Re-import matplotlib.pyplot for plotting tests and update assertions.
|
|
||
| import io | ||
|
|
||
| import matplotlib.pyplot as plt |
| import matplotlib.pyplot as plt | ||
| fig, ax = plt.subplots() | ||
| fig_out = res1.plot_forest(ax=ax, use_t=False) | ||
| assert fig_out is fig |
There was a problem hiding this comment.
I added the tests so this can move forward.
Fix the call to get_children() by removing the argument.
|
Thanks. |
Pass the
axparameter through todot_plotinCombineResults.plot_forestso that the caller's axes are reused instead of creating a new figure. Also removes the duplicateaxentry in the docstring and adds a regression test.Closes #8718