How can I set the width for embedded figures from Jupyter? #5919
Replies: 2 comments
-
Right now we don't actually have a great solution to this - when we 'render' the embedded content, we really are just copying the rendered result from the Jupyter Notebook into the page. This means that whatever rendering was put in place in the notebook, will persist into the rendered output. Can you share a sample document by any chance? I'd very much like to take a look at a real scenario and see whether I can see either a suggested solution or perhaps there is something we could do that would be smarted when embedding... |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick reply and the explanation! I am now working around it by saving the figure as png, and loading it into Quarto as an image figure. That works very well. 😊 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am rendering to PDF, and I am embedding a Matplotlib figure from a Python Jupyter notebook like so:
How can I set its width?
The problem is that my figure is very small, and should be small, and Quarto always scales it up automatically, which makes it blurry and too big. Disabling this automatic scaling would also work for me, then I could set the size via Matplotlib.
I have already tried:
{{< embed ../notebook.ipynb#my-figure >}}{width=40%}
# | fig-width: 40%
or# | width: 40%
in the notebookset_matplotlib_formats('png')
in the notebook:::{width=40%}
block around the figureI'm grateful for any help! 😊
Perhaps this is also a bug, and one of the above options should work? I don't know.
Beta Was this translation helpful? Give feedback.
All reactions