5

I've been working with Jupyter Notebooks for quite a while. When working with visualisations, I like to copy the output image from a cell by right clicking the image and selecting "Copy Image" from the context menu:

enter image description here

I like working with the direct copy from the notebook, especially for answering questions on Stack Overflow, so I'd rather not store them to disk. That would be a real reason to revert to legacy notebooks for me.

However with the Notebook 7 migration coming, I gave the beta a try by running pip install notebook --pre --upgrade and to my surprise I can't right click, copy the output image because the new Jupyter context menu pops up instead.

enter image description here

This really breaks my workflow. How can I copy an image from the output of a cell in notebook 7+?

Sebastian Wozny
  • 16,943
  • 7
  • 52
  • 69
  • Assuming you're using matplotlib, then you can just save the plot to disk – OneCricketeer Jul 09 '23 at 23:09
  • Did you try holding down `Shift` while right-clicking to access the native menu, as spelled out [here](https://github.com/jupyterlab/jupyterlab/issues/2685#issuecomment-315382217)? For context, Version 7 of Jupyter Notebook is built off JupyterLAb components (see [here](https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html) and [here](https://discourse.jupyter.org/t/notebook-7-pre-releases-are-available/16063?u=fomightez)), and that means that some of the interface and GUI abilities you can learn by seeing how JupyterLab users handled them. – Wayne Jul 09 '23 at 23:27
  • Oh yeah, that totally works @wayne. I think with the coming change to notebook many will hit the same problem. Feel free to detail it in an answer. – Sebastian Wozny Jul 09 '23 at 23:34

1 Answers1

4

Hold down Shift while right-clicking to access the native browser menu, as spelled out here.

For context, Version 7 of Jupyter Notebook is built off JupyterLab components (see here and here), and that means that some of the interface and GUI abilities you can learn by seeing how JupyterLab users handle them.


Tested by launching a temporary session via MyBinder from here and works in Chrome on a Mac.

Wayne
  • 6,607
  • 8
  • 36
  • 93