Closed machow closed 2 months ago
@machow You found the only thing I'm aware of, that the format fig-dpi
setting is forwarded to rcParams exactly where you've highlighted it.
I have fixed this. Though it is worth noting that the combination of savefig.dpi
and figure.dpi
parameters is delicate, preferably only figure.dpi
should be set.
https://github.com/quarto-dev/quarto-cli/issues/9470 is related to this in that we are still unable to get the expected display size.
Thanks for the quick fix! I think the retina issue won't impact my work too much, since things like seaborn also generate images ~1200px wide, but with a width on the screen of ~600px (due to quarto page content layout width). (But I could see how using retina info is useful here)
(I'm just piping in to say I love the issue
shortcode for the changelog, and we might end up adopting something like that in quarto-cli ourselves!)
I have fixed this. Though it is worth noting that the combination of
savefig.dpi
andfigure.dpi
parameters is delicate, preferably onlyfigure.dpi
should be set.
I know very little about matplotlib so I'm having a bit of trouble following the matplotlib issue. We'd be happy to change our defaults so that figure.dpi
is set, but what are the consequences?
savefig.dpi
is less used and usually users only set figure.dpi
and want the same value for both cases. The way to express that intention without values going out-of-sync in edgecases is by setting the savefig.dpi
to the string "figure"
.
plt.rcParams['figure.dpi'] = fig_dpi
plt.rcParams['savefig.dpi'] = "figure"
This way savefig.dpi
will never go out-of-sync, unless the user knows what they are doing. It easily goes out-of-sync because the dpi
of the figure can be altered (fig.set_dpi(42)
or by saving the figure in a different rcParams context after it has been created!).
Using "figure"
for savefig.dpi
is how matplotlib decided to implement the "one source of truth", made it the default setting and therefore you can omit it.
When using quarto with a qmd, setting the
theme(dpi=...)
option does not seem to affect plot output.example.qmd