You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plot Compositions don't render in Quarto with knitr #970
The new plot composition options are really exciting, but they don't work when the engine is set to knitr. (This issue might instead belong to Quarto or knitr.)
---title: "Plot composition in Quarto"engine: knitr---```{python}from plotnine import ggplot, aes, geom_point, geom_barfrom plotnine.data import diamondsp1 = ( ggplot( data = diamonds, mapping = aes(x = "carat", y = "price")) + geom_point())p2 = ( ggplot( data = diamonds, mapping = aes(x = "cut")) + geom_bar())```
Individual plots can be shown with `.show()`:
```{python}p1.show()```
Combined plots don't have a `.show()` method.
```{python}combined = p1 / p2combined```
When rendered, the last code chunk yields this as output: Stack(items=[<plotnine.ggplot.ggplot object at 0x108f3eb10>, <plotnine.ggplot.ggplot object at 0x10d893ac0>])
Activity
ENH: Improve getting output with quarto and the knitr engine
has2k1 commentedon Aug 28, 2025
Resolving this as part of #969, and when the plots are the last they should be shown automatically.
jmclawson commentedon Aug 28, 2025
Thanks, on both counts. I look forward to trying it out!
ENH: Improve getting output with quarto and the knitr engine