Refactor plotting to use backends and a consistent notebook experience
See original GitHub issue🐞 Problem
The experience with 2D and 3D plots in the notebook is inconsistent, due to the inconsistencies in the rendering between matplotlib and plotly. The transition from Jupyter notebook to JupyterLab is making things more difficult, as the documentation is scattered and now the users need to install JavaScript extensions as well.
Also, OrbitPlotter
and OrbitPlotter3D
do not share a common parent class and API, which is also a problem since most of the functionality is shared.
🎯 Goal
- Refactor the
plotting
module so it allows the user to configure a “backend”, via an environment variable or an IPython magic - Unify the
OrbitPlotter
andOrbitPlotter3D
classes, putting common functionality in a parent superclass - Use Plotly for the notebook, both in 2D and 3D, and leave a matplotlib backend for those that want static, publication-quality 2D
💡 Possible solutions
📋 Steps to solve the problem
- Comment below about what you’ve started working on.
- Add, commit, push your changes
- Submit a pull request and add this in comments -
Addresses #<put issue number here>
- Ask for a review in comments section of pull request
- Celebrate your contribution to this project 🎉
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
Adapt to Plotly 3.0 · Issue #397 · poliastro/poliastro · GitHub
Anyhow we should focus on the Figure class (we're implicitly using it in the ... Refactor plotting to use backends and a consistent...
Read more >Refactoring some code and maybe working on a project
Going to try and refactor some code live if possible and work on any side projects------------ Patreon ...
Read more >How should we be using matplotlib? - Data Management
We wrap any selection of a backend into a utility function that hides the matplotlib specifics from user code; We adopt the matplotlib.pyplot ......
Read more >How to Refactor a Codebase? - Better Programming
Name patterns, design patterns, and code formatting should be consistent. At least from yourself, stick to one style. For the team, you will...
Read more >Muhammad Hanif Mohamad Musa on LinkedIn: Refactoring a ...
Refactoring a Jupyter notebook into a maintainable pipeline: A ... the data is consistent across all the nodes, and thus all clients see...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
for the moment yes, although
BaseOrbitPlotter
should perhaps be private (so_BaseOrbitPlotter
) and we might think of just having one class and switching the behavior using a flag, or something like thatNow that OrbitPlotter2D shows nice plots, it’s time to start unifying OrbitPlotter2D and OrbitPlotter3D finding common code and putting it in a base class. I think we can take care of OrbitPlotter separately.