1

How can I increase the spacing between two rows in a four-subfigure plot using Quarto custom layout? I'm using Jupyter-lab for coding and Quarto to render pdf. And I have a four-subfigure plot like the one below (modified from the example in https://quarto.org/docs/authoring/figures.html):

#| label: fig-charts
#| fig-cap: Charts
#| fig-subcap: 
#|   - "First"
#|   - "Second"
#|   - "Third"
#|   - "Fourth"
#| layout-ncol: 2
#| layout: [[45,-10, 45], [45,-10, 45]]

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()

plt.plot([1,2,3,4])
plt.show()

plt.plot([1,2,3,4])
plt.show()

plt.plot([1,2,3,4])
plt.show()

I know by adding a negative number (-10) I can increase the horizontal spacing between two subfigures in the same row. But how can I increase the vertical spacing between two rows? I.e. the spacing between the first two and the last two figures? Thanks!


Edit: Problem solved. See below @shafee's comment! So I shouldn't have put layout-ncol and layout: together.

ShW
  • 43
  • 4
  • 1
    Try `layout: [[45,-10, 45], [-10], [45,-10, 45]]` – shafee Oct 04 '22 at 04:00
  • Doesn't seem to work, actually the whole `layout: [[45,-10, 45], [45,-10, 45]]` formatting doesn't work, don't know why... – ShW Oct 05 '22 at 00:03
  • 1
    Do not use `layout-ncol`, `layout` together. Remove the `layout-ncol: 2` and try `layout: [[45,-10, 45], [-10], [45,-10, 45]]` again. – shafee Oct 05 '22 at 03:55

0 Answers0