-
Notifications
You must be signed in to change notification settings - Fork 306
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
Regression: Multi-part figures get stretched in recent versions #9927
Comments
See work-around here: geocompx/geocompy#233 Follow-on question, are there any good work-arounds on the quarto side? |
Thanks for the report. Could you share a small self-contained example as you seem to imply the code cell options snippet (not reproducible) is enough? It's really important you strip out everything unrelated to s in your case (your GitHub repository) there are many possible cofounders. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
OK will try to create a minimal reprex.. |
Thanks! |
Here you go:
|
Try rendering that doc. You will see something like this, if the bug persists on your computer (figure should be square): I see no good reason for Quarto to stretch figures vertically like this without any instructions to do so or prior warning that it will. As per image above, it looked fine without the stretching. |
How it should look is shown in the image in the original post: #9927 (comment) That is how it does look on older versions of Quarto before this regression I think. We're not sure when the regression was introduced. |
You've requested |
You titled "regression", but compared to which version? |
We're not sure when the regression was introduced. |
I would expect the aspect ratio of the images not to altered, see the aspect ratio of the image below (zoomed in version of image in original post to highlight that this was also generated by Quarto): Source: geocompx/geocompy#230 (comment) In terms of the version of Quarto that generates that expected non-stretched version, I'm not sure but Michael might. @michaeldorman do you know what version of Quarto generated the image shown above? Thanks all. |
If you have the HTML, the Quarto version is written as metadata in it. |
- fig, ax = plt.subplots()
+ fig, ax = plt.subplots(figsize=(2, 2)) That looks like a good work-around. Would be great if the figures were not stretched without adding figsize arguments, as seems to have happened in older versions of Quarto. |
I've bisected it to a change from |
This is interesting, though. In the "good" versions, Quarto is completely removing the
Note The HTML output we produce in
Note how the height attribute got dropped. I think the fundamental problem here is that it's impossible for Quarto to properly handle existing sizing constraints on images inside a In a vacuum, what would be desired outcome here? In 1.4.366, Quarto actively decides to drop the height of the images in a layout cell, see
which calls quarto-cli/src/resources/filters/layout/width.lua Lines 129 to 135 in c5b6176
Note how line 134 drops the height. We'll fix this soon. |
great job! Will look to install latest version to fix on our book also. |
Any ideas of ETA when there will be a release with this patch? Just looking here https://github.com/quarto-dev/quarto-cli/releases |
Hi @cscheid I'm sorry to report that the issue persists for us. As I said, it was not an issue in previous versions but it persists. Any suggestions to keep the aspect ratio unchanges please let us know. Happy to provide more details. |
Fully reproducible example inside a devcontainer:
|
I've identified the cause here: subcaptions. Will open a new issue. |
Bug description
Quarto creates outputs in which figures are distorted with
layout-ncol
values above one, e.g. in the following reproducible example:Steps to reproduce
See code chunk above.
To reproduce, follow steps here: https://github.com/geocompx/geocompy
You can also reproduce in a devcontainer hosted on GitHub:
From there try typing
quarto preview
in the terminal.Expected behavior
It should look like this, as it did in previous versions of Quarto:
Source: geocompx/geocompy#230 (comment)
Actual behavior
The figures are stretched
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: