GEMDAT-repos / GEMDAT

Python toolkit for molecular dynamics analysis
https://gemdat.readthedocs.io
Apache License 2.0
21 stars 3 forks source link

Add option to switch between plotting backends #326

Closed stefsmeets closed 1 month ago

stefsmeets commented 1 month ago

This PR adds a user option to choose the backend for plotting.

The implementation is based on a decorator that strips the backend from the argument list and passes the plotting module (plots.matplotlib or plots.plotly) to the plotting method.

trajectory.plot_displacement_per_atom()  # default backend
trajectory.plot_displacement_per_atom(backend='matplotlib')
trajectory.plot_displacement_per_atom(backend='plotly')

Closes #319

Todo