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
Julia Makie rendering plots to incorrect IO with display
and PDF output format
#7548
Comments
Can you type |
I also don't understand why you need |
Honestly, I would argue that this is a Quarto bug. Using Although one could use the solution provided by @cscheid, the subfigure captions would be all wrong. I know that I can solve this using multiple axes in the Makie figure, but I hoped to use the responsive capabilities of Quarto. So my question is why does it work in HTML and not in PDF... Is there a difference in how the notebook is processed/rendered? And if so, where to look? What I discovered is that when one uses PDF output and
Also, what is the difference between returning The .qmd converted into .ipynb runs just fine and puts those figures into a column. (I included both .qmd and .ipynb as a .zip |
That's the recommendation for
Your message didn't specify you wanted captions and subcaptions. They work just fine with 1.4's new syntax:
This syntax exists precisely so that we can guarantee uniform behavior under third-party libraries that might not emit multiple outputs in a single cell. You can also use it to create figures whose contents are code, or text, or an iframe, etc.
We try to guess some common library setups and create the right configurations, but I think you can reasonably agree that it's a generally impossible task to guess at every possible library and configure them automatically. I agree with you that this is an issue of Makie configuration, but that means that you can configure that on your side.
If I understand your question correctly, that's not exactly a Quarto question, that's a Jupyter+Makie question. To investigate these issues, it's helpful to look at the intermediate notebook file generated by |
Yeah, that's true, sorry! I didn't consider them relevant or necessary for the MWE. And it's totally awesome that it can done via multiple execution cells in Quarto 1.4! I imagine it must be very hard to ensure compatibility across multiple libraries and languages. Well done!
Yeah, that's true I guess. Sorry!
I might do that, thank you. It is always quite complicated to see the entire pipeline/process at first with new software. All in all, I hope I wasn't too entitled or anything. I am very thankful for this level of immediate support/bugfix and for the awesome work, you (all) do at Quarto. Thanks! |
I have good news! This is, at least partially, a thing we can fix with Quarto. Here's a direct workaround for you:
We try to set figure formats in libraries, including CairoMakie, and in PDF format, this is clearly interacting badly with I think what we'll do is we won't change the default figure format to PDF in CairoMakie, since that's clearly going to break things. |
This is awesome! Thank you for your hard work and dedication, @cscheid! |
Just as a last thing to add, setting type to SVG ( |
I wonder if that's wise, though. We recently had a different issue in a different library where rendering to As quarto becomes more popular and used in broader settings, I unfortunately think that our defaults need to become more conservative, given that support-load ~= p(error) * number-of-users. |
Could be that this was a bug that I just fixed here MakieOrg/Makie.jl#3403 If the display type that Quarto uses accepts the application/pdf mime type, then it could be that it works with that change. I've actually never tried "inline display" for pdfs because VSCode, Pluto and the like don't support it. |
Bug description
When using
layout-*
option with Julia and Makie.jl, only for HTML output format the layout-plots are rendered correctly. (because thelayout-*
option, one needs to pass the plots usingdisplay
instead of justfig
at the end)For PDF output format, Julia opens separate windows containing PNG images of the layout-figures. Those images are then not included in the final PDF.
Steps to reproduce
This example should demonstrate the bug
Expected behavior
In the PDF, the layout plots will be present (thus rendered to the correct IO)
Actual behavior
The images are not in the PDF, but rendered to a different (probably the same as REPL) output
Your environment
quarto render <file>.qmd --to pdf
Quarto check output
The text was updated successfully, but these errors were encountered: