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
Retina images generated using ipython display functions do not have their dimensions set #9470
Comments
@has2k1 we are doing special handling for quarto-cli/src/core/jupyter/jupyter.ts Lines 1916 to 1933 in 163a059
Though as you see we do it when the dpi of the encoded This is because we set this option to be the one to use by matplotlib quarto-cli/src/resources/jupyter/lang/python/setup.py Lines 19 to 28 in 163a059
So when you set So I do believe it works as expected as long as no manual override is done. If some config is modified at the cell level, then this automated sizing won't apply. For the downloaded image, it is the same. If the DPI of the image does not match the Currently fig options are only at document level for Jupyrter engine, but hopefully we can adapt to make them work better at cell level In addition to all this, as no specific width and height are specify on the image and because responsive image is opt-in by default for HTML, the rendered size gets tweaked. If you set I tried to play with Anyhow. Does it help understanding the behavior here ? Not the best probably, but I don't think there is a bug per-se. What would you have expected from Quarto to do exactly ? Always curious of ideas to improve! |
First this commit fixes an error where `"key"` is used instead of `key`. Images created by ipython display functions(which includes matplotlib plots) may have the desired display width and height in the metadata. When they do, we fallback to those values instead of none. After this commit, the display size of images in jupyter notebooks that are rendered by quarto should be exactly the same as the sizes in their original environment. fixes quarto-dev#9470
First this commit fixes an error where `"key"` is used instead of `key`. Images created by ipython display functions(which includes matplotlib plots) may have the desired display width and height in the metadata. When they do, we fallback to those values instead of none. After this commit, the display size of images in jupyter notebooks that are rendered by quarto should be exactly the same as the sizes in their original environment. fixes quarto-dev#9470
You're welcome ! Happy to help any time. Feel free to ping me directly here or on slack if any question with Quarto |
Bug description
Images generated via jupyter/ipython and tagged as
retina
should be displayed in half the true pixel dimensions. For html format, the image tag should contain theheight
andwidth
that are half the true size.Generally, it is not possible to control the display size (and therefore the perceived resolution) of the output image using ipython display functions.
Steps to reproduce
Expected behavior
A a figure with image tag that has
height
andwidth
. i.e.Actual behavior
Quarto check output
The text was updated successfully, but these errors were encountered: