Last active
March 24, 2025 08:02
-
-
Save Ray901/149ad5aad12acb605d4eca862eb6b53b to your computer and use it in GitHub Desktop.
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
| from shiny.express import input, render, ui | |
| ui.input_selectize( | |
| "var", "Select variable", | |
| choices=["bill_length_mm", "body_mass_g"] | |
| ) | |
| @render.plot | |
| def hist(): | |
| from matplotlib import pyplot as plt | |
| from palmerpenguins import load_penguins | |
| df = load_penguins() | |
| df[input.var()].hist(grid=False) | |
| plt.xlabel(input.var()) | |
| plt.ylabel("count") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment