In MATLAB, there is a very convenient option to copy the current figure to the clipboard. Although Python/numpy/scipy/matplotlib is a great alternative to MATLAB, such an option is unfortunately missing.
Can this option easily be added to Matplotlib figures? Preferably, all MPL figures should automatically benefit from this functionality.
I'm using MPL's Qt4Agg backend, with PySide.
You can plot here in two ways with Matplotlib: via interactive Plotly. js plots, or SVG images. These examples are drawn from the Matplotlib documentation.
cla() Function. The cla() function in pyplot module of matplotlib library is used to clear the current axes. Syntax: matplotlib.pyplot.cla()
Matplotlib is a cross-platform, data visualization and graphical plotting library for Python and its numerical extension NumPy. As such, it offers a viable open source alternative to MATLAB. Developers can also use matplotlib's APIs (Application Programming Interfaces) to embed plots in GUI applications.
EelkeSpaak's solution was packed in a nice module: addcopyfighandler
Simply install by pip install addcopyfighandler
, and import the module after importing matplotlib or pyplot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With