Fix plot auto-display in Jupyter notebooks after style context change#616
Draft
Fix plot auto-display in Jupyter notebooks after style context change#616
Conversation
- Add show=True parameter to BaseExperiment.plot() method - Call plt.show() when show=True to enable auto-display in Jupyter notebooks - Create comprehensive tests for the show parameter functionality - Verify backward compatibility with existing code (default behavior auto-displays) - Enable users to set show=False for customization before display Co-authored-by: drbenvincent <6765047+drbenvincent@users.noreply.github.com>
- Address code review feedback - Move plt.show() call outside the style context block - Add comment explaining the reasoning - All tests still pass Co-authored-by: drbenvincent <6765047+drbenvincent@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix plots not auto-displaying in Jupyter notebooks
Fix plot auto-display in Jupyter notebooks after style context change
Dec 26, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #616 +/- ##
==========================================
+ Coverage 93.27% 93.33% +0.06%
==========================================
Files 37 38 +1
Lines 5632 5686 +54
Branches 367 368 +1
==========================================
+ Hits 5253 5307 +54
Misses 248 248
Partials 131 131 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
TODO: test by rerunning notebooks. If it works we can commit those and ready for merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit 9a88b01 wrapped plot generation in
plt.style.context(), breaking auto-display in Jupyter when assigning the return value (fig, ax = result.plot()). The context manager prevents the inline backend from automatically displaying figures.Changes
showparameter toBaseExperiment.plot(): Defaults toTrue, callsplt.show()after plot generation to restore auto-display behaviorplt.show()outside style context: Prevents style interference with display renderingUsage
Backward compatible—existing code unchanged.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.