Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add clipboard support to Matplotlib figures?

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.

like image 549
EelkeSpaak Avatar asked Jul 24 '15 09:07

EelkeSpaak


People also ask

Does Matplotlib support SVG?

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.

What is PLT CLA ()?

cla() Function. The cla() function in pyplot module of matplotlib library is used to clear the current axes. Syntax: matplotlib.pyplot.cla()

What does %Matplotlib do in Python?

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.


1 Answers

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.

like image 88
Vaiaro Avatar answered Sep 22 '22 04:09

Vaiaro