posit-dev / posit-dev/py-shiny

Set plot height dynamically using a function passed to @render.plot?

Open
#504 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

R-shiny has an option to specify a function that can be used to set the height of the plot window. I expected something similar to work for py-shiny with @render.plot as below. However, that returns an error (try_render_matplotlib() got multiple values for argument 'height')

Questions: Is there a way to set plot window height and width dynamically in py-shiny?

If this is a question better posted to posit community, please let me know.

@render.plot(height = my_function)
output$a_plot <- renderPlot({
...
}, height = my_function)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @render.plot API and the try_render_matplotlib() error shown in the issue, then check how height and width arguments are passed. Done means establishing whether callable dimensions are supported and, if so, covering the behavior; otherwise, document the supported approach or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.