Skip to content
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

Planning for pytplot 2.0 #159

Open
ericthewizard opened this issue Oct 28, 2021 · 2 comments
Open

Planning for pytplot 2.0 #159

ericthewizard opened this issue Oct 28, 2021 · 2 comments
Assignees

Comments

@ericthewizard
Copy link
Collaborator

ericthewizard commented Oct 28, 2021

I'm creating this issue to start the discussion of moving to pytplot 2.0!

TLDR:

For those of you unaware, I've been developing a version of pytplot that uses matplotlib to generate the figures instead of pyqtgraph; the development has been occuring under the 'matplotlib-backend' branch:

https://github.com/MAVENSDC/PyTplot/tree/matplotlib-backend

There's a jupyter notebook with examples of using this backend at:

https://github.com/MAVENSDC/PyTplot/blob/matplotlib-backend/docs/PyTplot%20examples%20with%20matplotlib.ipynb

For pytplot 2.0, I suggest that we make this backend the default, and deprecate the current Qt backend. I also think we should make this release ASAP.


Why?

I'm sure most of you have encountered some of the recent problems with pyqtgraph; this update will fix all of those issues and introduce several new features.

Bugs this fixes:

New features:

  • Publication quality figures (in addition to 'save_png', this update adds the options: 'save_eps', for saving postscript files, 'save_svg', for saving SVG files, and 'save_pdf' for saving PDF files)
  • Ability to create figures in Jupyter notebooks, including in Google colab, Deepnote, etc.
  • Option to return the figure and axes objects, so users can directly manipulate their figures; this allows users to add text, images, or make any other changes matplotlib allows (closes Allow text labels inside the plot? #8)
  • Option to add error bars to line plots, set via the 'dy' option when creating the variable with store_data (closes Add error bars to tplot #60)
  • Automatic interpolation options for spectrograms with the 'x_interp', 'y_interp' options (closes Interpolation options for spectrograms #146)
  • Overplotting lines on top of spectrograms (closes Overplotting curves on a spectrum #150)
  • 'xsize', 'ysize' keywords, for specifying figure size in inches
  • 'xmargin', 'ymargin' options, for specifying the margin sizes
  • MMS-style data segment bars
  • Automatic figure generation in docs via Sphinx extensions (https://matplotlib.org/sampledoc/extensions.html)
@sapols
Copy link

sapols commented Nov 2, 2021

I'm 100% for this. Me and at least two of my colleagues have spent a good amount of hours diagnosing QT-related errors caused by the current backend. QT stuff also killed PyHC's Gallery page (broke the CI deployment) and prevented us from deploying updates. In another case, a project I know about had to drop pySPEDAS because its PyTplot dependency was breaking things.

Matplotlib is the Python standard for plotting things anyway so it makes sense to use it. And it's a big plus to gain compatibility with new platforms, namely notebooks running in browsers, because the pyqtgraph stuff won't be trying to open plots in separate windows.

@ericthewizard
Copy link
Collaborator Author

I'm 100% for this. Me and at least two of my colleagues have spent a good amount of hours diagnosing QT-related errors caused by the current backend. QT stuff also killed PyHC's Gallery page (broke the CI deployment) and prevented us from deploying updates. In another case, a project I know about had to drop pySPEDAS because its PyTplot dependency was breaking things.

Matplotlib is the Python standard for plotting things anyway so it makes sense to use it. And it's a big plus to gain compatibility with new platforms, namely notebooks running in browsers, because the pyqtgraph stuff won't be trying to open plots in separate windows.

Thanks, Shawn!

I came across a book this morning that really showcases how powerful matplotlib is:

https://github.com/rougier/scientific-visualization-book

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

3 participants