matplotlib / matplotlib/matplotlib
Copy to Clipboard not Enabled by Default
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
### Bug report
**Bug summary**
Copy Canvas tool seems to have been implemented in v3.0 as in #10446 but is not enabled in Matplotlib 3.0.2 by default. Copy/paste functionality can be restored using `plt.rcParams['toolbar'] = 'toolmanager'` but creates warnings as in #7404
**Code for reproduction**
```python
# Paste your code here
# plt.rcParams['toolbar'] = 'toolmanager' #restores copy to clipboard functionality by replacing toolbar2 with toolmanager
x = np.linsapce(1,10); y = np.linspace(1,10)
fig, ax = plt.subplots()
ax.plot(x, y)
plt.show()
```
**Actual outcome**
Default behavior (no copy/paste functionality, toolbar2)

Setting toolbar to toolmanager (copy/paste functionality, toolmanager). Console warning output shown below when activated

```
# If applicable, paste the console output here
C:\Users\Alex\Miniconda3\envs\vanilla\lib\site-packages\matplotlib\backend_managers.py:58: UserWarning: Treat the new Tool classes introduced in v1.5 as experimental for now, the API will likely change in version 2.1 and perhaps the rcParam as well
'experimental for now, the API will likely change in ' +
C:\Users\Alex\Miniconda3\envs\vanilla\lib\site-packages\matplotlib\backend_tools.py:79: UserWarning: Treat the new Tool classes introduced in v1.5 as experimental for now, the API will likely change in version 2.1, and some tools might change name
'experimental for now, the API will likely change in ' +
```
**Expected outcome**
Pressing ctrl+c or cmd+c should copy figure to clipboard as in #10446 and rcParams documentation by default. It seems that it must be explicitly turned on at the moment
**Matplotlib version**
* Operating system: Windows 10
* Matplotlib version: 3.0.2, installed via conda (default channel)
* Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg
* Python version: 3.7.1
* Jupyter version (if applicable): N/A
* Other libraries:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with Matplotlib 3.0.2 using the Qt5Agg backend, comparing the default toolbar with rcParams['toolbar'] set to 'toolmanager'. Start at the toolbar, toolmanager, and copy-to-clipboard entry points mentioned in the report. Done means Ctrl+C or Cmd+C copies the figure by default without the reported experimental-tool warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100