-
Notifications
You must be signed in to change notification settings - Fork 293
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
[Feature Request] ideas for improving plot rendering and Python Interactive tab per se #3676
Comments
I don't think this is technically feasible. Not without reworking everything to use a separate node process (not a vscode webview). Is the sole benefit of this being able to move the interactive window to a separate monitor? |
Just an idea and I didn't know if this will cause too many troubles. My workflow involves lots of data visualization and display the output in a vertical screen will make the work more effiecient, which is why I always use Jupyter lab in my vertaical screen. It will also make another window themeable to increase readability like suggested in microsoft/vscode-python#3773 microsoft/vscode-python#3978 maybe? |
I don't think this would make themeing any easier. We'd still have to use the same color theme as vscode and they don't expose this to us right now. Theming other parts (graph backgrounds and such) would be feasible in either, although the setting of them would still be done from vscode. |
Maybe add a background to each cell or adjust the greyscale of each cell like this extension? |
It should already be doing that? Are you having trouble viewing something in particular? |
The extension doesn't highlight any code so it doesn't really have any viewing issue and it doesn't run cells either and you need to select code manually to |
Sorry I didn't understand that at all. You do get the 'Run cell | Run All Cells' items on top of cells, right? Or are you talking about code without '#%%' in it? Why would you be doing |
Are you talking the Python extension or? You can add a backgroud to each cell in the Pyhton Interactive tab already? Maybe I missed something? |
The python extension should be forcing a background on the output. And we should be fixing up matplotlib so that it uses colors based on the theme. Right now the only issue should be the code doesn't colorize correctly. I suppose a workaround for us would be to allow you to set a background color for the code. |
This would be great. I actually kind of like a dark theme. Will this be fixed in the next release? |
Which 'this' are you referring to? Colorization will get better (you can actually try it out right now with our insiders build) but still won't exactly match VS code. VS Code has an issue that prevents us from using their colors. They don't expose them. As far as background color being settable, not sure if we'll do that or not. You should log a separate issue if you want that and other people can up vote it. Sounds useful, but maybe only because our colors don't match your theme. |
First let's check if it actually installed or not. If you go to settings and type in 'DataScience', do you have something that says: If that's true, what are you plotting with? Matplotlib should be picking up your theme. You can see us execute this if you go to Help | Developer Tools and look at the console output. For me I have this in there: |
Ah looks like there's a bug with our matplotlib themeing. It only works if the theme has the word 'dark' in it. Doh. @IanMatthewHuff is logging an issue to fix that part. |
What's your version of VS code? |
Ah. Yeah we have a problem where if you change the theme the window doesn't update. That's a separate issue (#3183) Glad it works after refresh though :) |
I think it's more likely that the 'Atom Material Theme' is not a default VS code theme. I don't have that one. Do you know how you got it? Our hack for loading the vs code colors is likely not working for that one. |
It's not and you can downlaod it: |
Tried One Dark Theme as well and it indeed doesn't fix the colorization issue in third-party theme |
Yeah it's installed in a different location than the default themes. Thanks. I'll enter a new bug to handle custom themes. |
٩( ᐛ )و glad to help! Btw, It seems like the new insider build add a new feature to not fully toggle vertically long plots right? I just looked at the settings, and it doesn't seem like there is a way to set it to toggle the expanded output by default. I assume this was added since big plots may take too many spaces right? This is actually the original reason why I opened this issue so that users can adjust the aspect ratio, but a separate window seems hard to achieve like you mention above and discussed in microsoft/vscode-python#10121. I think there should be a setting to toggle the full ouput by defualt, right? |
Yeah I should add a setting for that. Thanks. Sometimes you want it to show the full thing. |
How bout like Defaults to '300' but you can put -1 or any number you want. It's just a css style for us internally. |
No, the setting doesn't exist yet. I'm going to add it right now (I'm changing this code as we speak). I was asking your opinion on how you'd want it to behave. |
That sounds better. They likely check the output type before adding the scrollbar |
Great! I've edited the title and original post based on our discussion. |
@rchiodo Btw, will there be a setting for the Python Interactive tab to adjust the Markdown text font size? The current font size for the regular text (except headers) is way too small I think. I wish there could be a setting to adjust it independently from the code font size in the editor. |
You're best bet for something like that would be to enter a separate issue. Eventually one of us will pull apart this issue here and add new items for each, but if you want something specific, you'd be better off entering that as a specific request. I believe we get our markdown font/sizes from the @nteract. Not sure at the moment if we can change them or not. |
interesting, I was actually wondering if there could be something like Hydrogen. I will open another issue for the font size. |
Related to this thread, I see that there has been an update to use the matplotlib 'dark_background' theme whenever the editor is in a dark theme mode for plots in the output window. Is there a way to change this behavior by default in VS Code? It's fine to look at plots with the dark background in the interactive window, but it's annoying having to re-generate all of the theme settings every time I want to save a plot with a white background. Using matplotlib canned styles doesn't seem to help either (at least with the backgrounds and font colors; see screen shot, below). That is, can we customize whether or not this extension defaults to the dark background theme when we have a general dark theme in Code? I'd like to keep my plots with a white background/black font without having to piecemeal set parameters. |
Well technically we fixed a bug that made this 'work' for the first time on all themes recently. This is how we intended it to always work. This is a tough problem though. We'd need to generate the plots twice for each. One that's visible on the interactive window and one for export. @dstanner, When you say 'save a plot with a white background' how are you saving it? Are you talking about export, or are you copying it to the clipboard? |
This is more specific than export. Can you enter a feature request/new issue? Just include your picture above. This issue that Steven has entered is more generic. I think your needs could be met sooner if we split it out. |
sounds good! Thanks! |
@rchiodo So in the python interactive window, the plot will rescale if I change the size of it as those gifs above shows. However, sometimes some packages may print out a long warning message or even a long dataframe and a scroll bar will apply at the bottom so that the plot no long auto rescale itself. Is there any solution for this issue right now? Does this have anything to do with: I think maybe a scroll bar for those long output under those cells may be better. |
I believe this is a dupe of #1528. MaxOutputSize is for the vertical size. We have no way to control the horizontal width at the moment. |
I think what you're really asking for is a way to dynamically size plots no matter what else is on the screen? |
@rchiodo It is amazing how many works you guys have done to make everything mentioned in this issue happen. The only remaining issue is this horizontal width and seems like you've got it here |
vscode
: 1.30.2python extension
: 2018.21.1Under the current version, if a user opens a new window with
Ctrl+K
O
and thenRun Cell
in the new window. A new Python Interactive (kernel) tab will be opened aside in the window.Separate the code editor and the python interactive tab into two windows. This will enable the users to use different aspect ratios of the two windows and make the usage of the screen more efficient. For example, if one has a two-screen setup, put the code editor in the horizontal screen and python interactive window in the vertical one. Btw, I saw some discussion here and wonder if this is too hard to achieve now.
Fix the colorization issue to increase readability of the outputs.
Large plots will be automatically fitted on your screen and fully toggle it when you double click it, like Jupyter lab.
The text was updated successfully, but these errors were encountered: