How to Reduce Image Size in VS Code Jupyter Notebook Display without Altering figsize
or dpi
?
#16091
Replies: 1 comment
-
Closing in favour of #16092 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem Description:
I am currently using a Jupyter Notebook inside VS Code to generate plots using
matplotlib
. The final plots must adhere to specificfigsize
anddpi
settings for journal submission, so I cannot alter these parameters. However, when displaying the figures in VS Code, they appear excessively large, occupying the full width of the output cell. My goal is to reduce the visual size of the image in the VS Code output cell without affecting the actual dimensions of the saved figure.Currently, the images generated by
matplotlib
are rendered to take up the entire width of the cell (as seen in the screenshots), but I would like them to be rendered at half of that size.Example Code:
Here’s an example of the general code structure I’m using:
What I've Tried So Far:
Using CSS/HTML scaling in the notebook: I tried injecting custom CSS through IPython.display.display() and HTML() to modify the height of the images in the output cell.
but it doesn't work for me.
Does anyone have a workaround or solution for reducing the display size of images in VS Code Jupyter Notebook without altering the figure’s actual dimensions?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions