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
You can change the default sizes using the fig-width and fig-height options
(...)
For Python, these values are used to set the Matplotlib figure.figsize rcParam (you can of course manually override these defaults for any given plot).
(...)
If you are using another graphics library with Jupyter and want to utilize these values, you can read them from QUARTO_FIG_WIDTH and QUARTO_FIG_HEIGHT environment variables.
The problem seems to be that we do set env var for the kernel
And this is a problem for all values set
But we probably don't force a restart if the value change.
Run this once with Jupyter kernel not open quarto render index.qmd --execute-daemon-restart
---title: 'Fig size'format: html---```{python}import osprint(f'QUARTO_FIG_WIDTH: {os.environ["QUARTO_FIG_WIDTH"]}')print(f'QUARTO_FIG_HEIGHT: {os.environ["QUARTO_FIG_HEIGHT"]}')print(f'QUARTO_FIG_DPI: {os.environ["QUARTO_FIG_DPI"]}')print(f'QUARTO_FIG_FORMAT: {os.environ["QUARTO_FIG_FORMAT"]}')``````{python}# Get the value of figure.figsizeimport matplotlib.pyplot as pltprint(f'Default figure size: {plt.rcParams["figure.figsize"]}')print(f'Default figure size: {plt.rcParams["figure.dpi"]}')```
Now modify the YAML header and re-render with the keep-alive kernel
---title: 'Fig size'format:
html:
fig-width: 1fig-height: 2fig-dpi: 450fig-format: svg---```{python}import osprint(f'QUARTO_FIG_WIDTH: {os.environ["QUARTO_FIG_WIDTH"]}')print(f'QUARTO_FIG_HEIGHT: {os.environ["QUARTO_FIG_HEIGHT"]}')print(f'QUARTO_FIG_DPI: {os.environ["QUARTO_FIG_DPI"]}')print(f'QUARTO_FIG_FORMAT: {os.environ["QUARTO_FIG_FORMAT"]}')``````{python}# Get the value of figure.figsizeimport matplotlib.pyplot as pltprint(f'Default figure size: {plt.rcParams["figure.figsize"]}')print(f'Default figure size: {plt.rcParams["figure.dpi"]}')```
Matplot lib config is updated, but not the environment variable
As the environment variable are meant to be used by other graphic package in python not using matplotlib, I think they should be updated if possible, or the configuration change should trigger a restart of the kernel.
The text was updated successfully, but these errors were encountered:
I noticed that with figure value as our doc at https://quarto.org/docs/computations/execution-options.html#figure-options says
The problem seems to be that we do set env var for the kernel
And this is a problem for all values set
quarto-cli/src/resources/jupyter/notebook.py
Lines 106 to 114 in 83a3b5a
quarto-cli/src/resources/jupyter/notebook.py
Lines 181 to 182 in 83a3b5a
But we probably don't force a restart if the value change.
Run this once with Jupyter kernel not open
quarto render index.qmd --execute-daemon-restart
Now modify the YAML header and re-render with the keep-alive kernel
Matplot lib config is updated, but not the environment variable
As the environment variable are meant to be used by other graphic package in python not using matplotlib, I think they should be updated if possible, or the configuration change should trigger a restart of the kernel.
The text was updated successfully, but these errors were encountered: