Render unsized plots at the default figure size in notebook sessions - #1389
Open
seeM wants to merge 8 commits into
Open
Render unsized plots at the default figure size in notebook sessions#1389seeM wants to merge 8 commits into
seeM wants to merge 8 commits into
Conversation
seeM
force-pushed
the
feature/default-plot-size
branch
from
August 4, 2026 08:39
4046cac to
4d3e3a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses posit-dev/positron#15260.
This PR is stacked on #1387.
Summary
When a notebook cell does not specify
fig-widthorfig-height, Ark currently sizes its plots tooutput_width_pxwith a 4:3 aspect ratio. This makes plots expand with the viewport and become especially large when the editor is wide or other panes are minimized.This PR instead renders unsized plots at Quarto's default figure dimensions: 7 × 5 inches. This matches
quarto renderand is analogous to the Python kernel falling back to Matplotlib's default figure size.The same default applies when an execute request contains no Positron metadata, including requests from standard Jupyter frontends. At Ark's platform-default DPI, the resulting logical dimensions are:
output_width_pxremains part of the protocol but no longer affects plot sizing.Additional changes
output_pixel_ratiois applied independently of figure dimensions, so unsized plots remain sharp on HiDPI displays.PlotSizingtype inplots/sizing.rs.ark.plot.widthorark.plot.height;fig-widthorfig-height;Screenshots
Before and after: unsized plot in a wide Quarto editor
Explicit figure dimensions remain supported
Unsized plots remain sharp on HiDPI displays
QA
With inline output enabled in a Quarto document:
plot(1:10)without cell options. It should render at 7 × 5 inches regardless of the editor width.fig-widthandfig-height. The plot should use those dimensions.ark.plot.widthorark.plot.height. Each R option should override the corresponding cell option.