White background fills entire output cell for Matplotlib plots
See original GitHub issueWhen I make a simple matplotlib plot, there is a white background covering the entire output cell area, which is pretty jarring in dark themes. I would expect it to only be white in the area immediately behind the figure. Also, I’m not sure why there is a small dark cutout in the lower right corner of the white background.
I’m guessing that it’s built this way because by default, the figure background is transparent. However, even if the plot image was partially transparent, I would not expect that to affect any parts of the screen beside the image itself, so this might be undesirable behavior.
Steps to reproduce:
- Create new blank notebook
- Enter code in cell:
import matplotlib.pyplot as plt
plt.figure()
plt.plot([1,2], [1,2])
plt.show()
- Run cell
Environment data
- VS Code version: 1.61.0-insider
- Jupyter Extension version: v2021.9.1001208778
- Python Extension version: v2021.10.1210725981-dev
- OS: Windows 10
- Python 3.9.7
- Type of virtual environment used: none
- Jupyter server running: Local
- No other extensions running besides Python + Jupyter
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
How to Set Plot Background Color in Matplotlib?
From the below figure one can infer that a plot consists of X-axis, Y-axis, plot title and the axes. By default, the color...
Read more >How to set opacity of background colour of graph with ...
If you just want the entire background for both the figure and the axes to be transparent, you can simply specify transparent=True when...
Read more >Dark background style sheet
This example demonstrates the "dark_background" style, which uses white for elements that are typically black (text, borders, etc). Note that not all plot...
Read more >Cell output and plot background colors in DataSpell ...
However, I would like my plots to have white backgrounds. Changing the settings through matplotlib does not seem to work. I've searched ...
Read more >4. Visualization with Matplotlib - Python Data Science ...
In visualization of data and results, showing these errors effectively can make a plot convey much more complete information. Basic Errorbars. A basic...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@charlieh108 Looks like you might be missing the Jupyter renderers extension. VS Code separates execution from display so different extensions can provide different output renderings. The Jupyter renderers extension is supposed to install with the main Jupyter extension, but it looks like you are missing it. Try installing that, it should provide the right views:
You can see in my second image that it’s using the renderer from that extension.
I don’t know what exactly it does, but there is a
vscode
setting which may or may not help in this instance: