serpentine-h2020 / serpentine

Python tools and software developed by the SERPENTINE project for data downloading and performing of analysis and visualisation
https://serpentine-h2020.eu/tools/
BSD 3-Clause "New" or "Revised" License
18 stars 2 forks source link

Change plotting to a more interactive library #7

Open jgieseler opened 1 year ago

jgieseler commented 1 year ago

Currently, all plots are done using matplotlib code and %matplotlib inline in the Notebooks to produce static plots. However, it would be really helpful to have some interactive plotting functionality, e.g. to change the plotting range. This needs at the moment to be done manually, and it is one of the main sources for Python errors when working with the tools (because the user changes e.g. the time range for the data loading, but not the plotting range).

While %matplotlib notebook provides automatically some interactive functionality, it still has some problems. For example, when the whole notebook is executed, the output figures only appear after all cells have been processed, which can be quite confusing for the user and is problematic if the execution fails somewhere in between. On the other hand, changing from %matplotlib inline to %matplotlib notebook would be quite easy, only some things like the dpi settings would need adjustments.

There are also other, more "modern" plotting libraries that provides interactive plotting. For example, bokeh or plotly. The downside is that they don't offer as much functionality as matplotlib (so we would need to check if the plot can actually be reproduced with these tools), and that our actual code would need more rewriting. This shouldn't be too much, and maybe even a got lesson to learn the new plotting library.