-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow copying an image result from Python Interactive window #1470
Comments
Selecting and "ctrl-c" on the plot in the Interactive window will copy the image out. Though we don't yet have a context menu support for this. |
Thanks @IanMatthewHuff. I tried more ideas due to your comment, and you're right that I can paste into GSuite (Gmail, GDocs). It still doesn't work for Slack (Windows, Linux) or Word (Windows), but having it work for GSuite is already very helpful -- thanks! Summary of current situation:
|
@andrewdelong Thanks for checking that out for us. Glad that you are (somewhat) unblocked for now. I'll look into the pasting issues as I'm surprised that Word in particular doesn't work. We also want to get a context menu in here for this so it's more discoverable. |
I was just playing with this a bit myself and I was able to paste into Word, but it was odd. Some sections would paste and others would not and getting selection correct was tricky as well. Will have to look into this more as a whole "copy / paste correctly" meta issue. |
SO issue. In addition to Copy have a save to file button? |
Somewhat related to this is the 'theme' for the plot. We force dark on dark themes, but the user may wish to save/copy the plot as a different theme. See some of the discussion in microsoft/vscode-python#4009 |
@IanMatthewHuff is it possible that selection support for output images was removed in the last few versions? I've got extension version 2019.3.6558 and clicking on output images does nothing. Neither does pressing ctrl-c. :( This is my first time trying VSCode for Jupyter notebooks and I immediately ran into this problem since my primary way of getting images out of notebooks and into emails / presentations is copy&pasting them. Also I'll need to find a way to get rid of the dark theme on plots, but that's another google. |
Hey @stmax82 . Currently the support that we do / did have for selecting output images is just based on what we get by default for being in a vscode hosted webview. I don't believe that it should have changed recently, but since this is not something that we have directly added we don't have any specific tests around it. We have the issue referenced above for getting this support fully in and solid. For what it's worth I just poked around a bit myself. If I did a drag selection over the matplotlib graph (so that I could see a selection around it) I was able to ctrl-c it and paste it into word. Sorry that we don't have this better supported yet, but does that work for you as a workaround? |
@IanMatthewHuff looks like the trick is selecting the image by dragging the mouse over it - not clicking on it (like I tried before). But still, not sure what I'm doing wrong, this is what I get: Selection in VS Code: Result in Word: Anyway, I can already move some notebooks over to VS Code where I don't need to export the plots and keep the rest in jupyter for a while. |
Sorry I'm not able to repro that odd looking box in your copy result. I think that might be how the code input box that use at the bottom to enter new code is coming out in a copy operation. I think that the best thing we can say for now is that this issue is open and on our radar to make sure that we have a good copy story. |
Let's support a context menu on images with "Open Viewer" and "Copy". |
This isn't possible without this working: |
@dpsugasa the export button should allow you to save as PDF/PNG. That was working until this change: Although unless you're on our insider's build, you shouldn't have that change. I've added an issue (https://github.com/microsoft/vscode-python/issues/7257) to fix that before our next release. In relation to this request:
I don't think that will be coming anytime soon. We don't do the plotting ourselves (it's handled by Jupyter) and in order to generate an image in a different theme, we'd have to rerun the plot code. |
It'll be cool if we can copy the image straight from vscode. |
Not quite the same issue as above but related and I can't find a more similar issue. Is it possible to expand images from the python interactive window into the plots viewer programmatically (rather than having to click on the 'Expand image' button for individual images)? |
@michaelberks sorry but that is not possible. I assume you mean with code in your cell? Could you enter a new issue for this suggestion? Thanks. |
Yes, exactly. I'll open a new issue, would be a hugely useful feature for me. UPDATE: Just created as issue microsoft/vscode-python#8947, thanks! |
I also found I can drag and drop into google products (Gmail, Google Slides) On Mac, a work around to get to Slack is drag and drop into Finder, a .png file is rendered, then drag and drop into Slack (or wherever) |
It's 2021, it would be good to be able to copy the figures from the interactive figure viewer... |
Any development on this issue? |
Sorry but this is not currently supported. There is no context menu for output in either the stable or insiders build nor any way to use the clipboard to copy output images. This should probably be an upstream bug in VS code. The only thing that works (on windows) is you can drag images out of the view to windows explorer to create a download.png. |
Moving back to triage to see if we can get VS code to support copy on output. |
Any option such as right click menu or button after double click (currently
downloads as pdf) would be great. Spyder works great in this manner.
3 Şub 2021 Çar 20:19 tarihinde Rich Chiodo <[email protected]> şunu
yazdı:
… Moving back to triage to see if we can get VS code to support copy on
output.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1470 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJUM4XH4ACF4AJ2VJLFIC5LS5GAR3ANCNFSM4TVD4NBQ>
.
|
Just wanna discuss with VS Code team about what could be done here. |
with today updating. Double click doesn't go edit panel. |
It is possible to save the file to local and then copy it. However copying it directly from the output would save us some time. |
It would be very useful to get this feature. I ended using the Snipping Tool as a workaround, which is almost as fast as being able to CTRL+C in VS Code. |
I'm on MacOS. I was always able to Copy / Paste image results from the Python interactive window by highlighting/selecting the graphic with the mouse and pressing CTRL+C. However, this functionality seems to have broken in the 1.60 update. I can click+drag the image result into some applications (e.g. an outlook email), but that doesn't work in some other applications (e.g. MS Teams). |
For charts, copy CTRL+C not working with 1.60 on windows. |
I didn't want to create a new issue, but it appears some of the functionality discussed herein is further broken in the new vs code notebooks. Also, my main way of using plots before, dragging them out of vs code directly into powerpoint, no longer works. I must drag them into a windows explorer folder and then into powerpoint. |
A copy to clipboard feature was added to the renderer in microsoft/vscode#129880 |
Environment data
Expected behaviour
It'd be great if Python plots within the IDE could be copied to the clipboard. I'd expect right-click to show a menu with "Copy" as an option, for example.
Copying pasting quick plots into Slack/e-mail is super convenient for sharing intermediate results with colleagues.
Actual behaviour
Copying code from Python Interactive works (including rich formatting), but copying images does not. Right-clicking on the image does not show a menu. Selecting the image as part of the surrounding code does not include the image.
Workaround: Take screenshot, paste into image editor, crop, copy-paste the crop, close image editor.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: