Skip to content
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

Matplotlib plot cannot ignore Vscode theme in Python Interactive Window and button images not changed on theme swaps. #2961

Closed
vzhangCM opened this issue Oct 9, 2019 · 8 comments
Assignees

Comments

@vzhangCM
Copy link

vzhangCM commented Oct 9, 2019

Bug: Notebook Editor, Interactive Window, Python Editor cells

Steps to cause the bug to occur

  1. change the Vscode theme to dark+
  2. enable 'Python > Data Science: Ignore Vscode Theme'
  3. restart Vscode
  4. plot a figure via matplotlib in Python Interactive Window

Actual & Expected behavior

The figure is expected to ignore the dark theme and has white background.
But the actual background color is black in the latest version 2019.10.41019. No issue in version 2019.9.34911.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local | Remote | N/A
  • Extension version: 20YY.MM.#####-xxx
  • VS Code version: #.##
  • Setting python.jediEnabled: true | false
  • Python and/or Anaconda version: #.#.#
  • OS: Windows | Mac | Linux (distro):
  • Virtual environment: conda | venv | virtualenv | N/A | ...

Developer Tools Console Output

@rchiodo
Copy link
Contributor

rchiodo commented Oct 10, 2019

Hmm. Yeah looks like we aren't checking ignore during load of the jupyter server.

@teristam
Copy link

I also have the same problem. Is there a temporary fix for now?

@rchiodo
Copy link
Contributor

rchiodo commented Oct 14, 2019

Yes, you can force the matplot lib to use the white theme.

Either run a cell with this code in it:

matplotlib.rcParams.update(_VSCode_defaultMatplotlib_Params)

or put that code into this setting:

python.dataScience.runStartupCommands

_VSCode_defaultMatplotlib_Params is a hidden variable we create on startup with the default params for matplotlib. Since it defaults to the white background, setting the matplotlib params to this value will reset the plots.

@IanMatthewHuff IanMatthewHuff self-assigned this Oct 21, 2019
@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented Oct 23, 2019

Looks like the icons might be off in this situation as well. At least to me it looks like dark theme icons were being used on the light non-themed control.

Yeah, there is a larger issue at play. Icons / buttons also don't swap on theme changes light / dark.

@IanMatthewHuff
Copy link
Member

Validation notes please check that on a swap from light to dark theme that images in the native editor and the interactive window change to correctly match the new theme. This was not working previously.

@IanMatthewHuff IanMatthewHuff changed the title Matplotlib plot cannot ignore Vscode theme in Python Interactive Window Matplotlib plot cannot ignore Vscode theme in Python Interactive Window and button images not changed on theme swaps. Oct 24, 2019
@IanMatthewHuff
Copy link
Member

Second validation note (noticed more theme issues while testing) change the plot viewer to respect the new "themeMatplotlibPlots" setting.

@rchiodo rchiodo self-assigned this Oct 25, 2019
@rchiodo
Copy link
Contributor

rchiodo commented Oct 25, 2019

Validated except for selection rectangle around the plots

@IanMatthewHuff
Copy link
Member

Validation fixes here:
microsoft/vscode-python#8224

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants