Search code examples
pythonjupyter-notebookcopy-paste

How do I copy an image from the output in Jupyter Notebook 7+?


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+?


Solution

  • 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.