Skip to content

How do I specify the file path for figures rendered using Python? #12056

Answered by mcanouil
marcdotson asked this question in Q&A
Discussion options

You must be logged in to vote

Jupyter/IPYthon does not offer this as far as I know. (images are base64 encoded inside the notebooks)
For knitr, the option comes directly from it, not from Quarto.

For now, Quarto sets some default using options such as fig-height, etc.

  • try:
    import matplotlib.pyplot as plt
    plt.rcParams['figure.figsize'] = (fig_width, fig_height)
    plt.rcParams['figure.dpi'] = fig_dpi
    plt.rcParams['savefig.dpi'] = "figure"
    from IPython.display import set_matplotlib_formats
    set_matplotlib_formats(fig_format)
    except Exception:
    pass

Unless explicitly saving the image…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mcanouil
Comment options

Answer selected by marcdotson
@marcdotson
Comment options

@mcanouil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants