ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.4 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | FAIL | meta_canonical IS NULL OR = '' OR = src_unparsed | co,posit!shiny,/components/outputs/plot-seaborn/ s443 |
| Property | Value |
|---|---|
| URL | https://shiny.posit.co/py/components/outputs/plot-seaborn/ |
| Last Crawled | 2026-04-02 23:57:17 (11 days ago) |
| First Indexed | 2024-12-20 21:55:26 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | Plot (Seaborn) – Shiny for Python |
| Meta Description | null |
| Meta Canonical | co,posit!shiny,/components/outputs/plot-seaborn/ s443 |
| Boilerpipe Text | #| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| components: [viewer]
#| viewerHeight: 500
import seaborn as sns
from palmerpenguins import load_penguins
from shiny import App, render, ui
penguins = load_penguins()
app_ui = ui.page_fluid(
ui.input_slider("n", "Number of bins", 1, 100, 20),
ui.output_plot("plot"),
)
def server(input, output, session):
@render.plot(alt="A Seaborn histogram on penguin body mass in grams.")
def plot():
ax = sns.histplot(data=penguins, x="body_mass_g", bins=input.n())
ax.set_title("Palmer Penguins")
ax.set_xlabel("Mass (g)")
ax.set_ylabel("Count")
return ax
app = App(app_ui, server, debug=True)
Express
Core
import
seaborn
as
sns
from
palmerpenguins
import
load_penguins
from
shiny.express
import
input
, render, ui
penguins
=
load_penguins()
ui.input_slider(
"n"
,
"Number of bins"
,
1
,
100
,
20
)
@render.plot
(alt
=
"A Seaborn histogram on penguin body mass in grams."
)
def
plot():
ax
=
sns.histplot(data
=
penguins, x
=
"body_mass_g"
, bins
=
input
.n())
ax.set_title(
"Palmer Penguins"
)
ax.set_xlabel(
"Mass (g)"
)
ax.set_ylabel(
"Count"
)
return
ax
import
seaborn
as
sns
from
palmerpenguins
import
load_penguins
from
shiny
import
App, render, ui
penguins
=
load_penguins()
app_ui
=
ui.page_fluid(
ui.input_slider(
"n"
,
"Number of bins"
,
1
,
100
,
20
),
ui.output_plot(
"plot"
),
)
def
server(
input
, output, session):
@render.plot
(alt
=
"A Seaborn histogram on penguin body mass in grams."
)
def
plot():
ax
=
sns.histplot(data
=
penguins, x
=
"body_mass_g"
, bins
=
input
.n())
ax.set_title(
"Palmer Penguins"
)
ax.set_xlabel(
"Mass (g)"
)
ax.set_ylabel(
"Count"
)
return
ax
app
=
App(app_ui, server, debug
=
True
)
No matching items
Relevant Functions
ui.output_plot
ui.output_plot(id, width='100%', height='400px', *, inline=False, click=False, dblclick=False, hover=False, brush=False, fill=MISSING)
@render.plot
render.plot(_fn=None, *, alt=None, width=MISSING, height=MISSING, **kwargs)
No matching items
Details
Seaborn is a statistical plotting library that builds on top of Matplotlib.
Follow these steps to display a Seaborn figure in your app:
Add
ui.output_plot()
to the UI of your app to create a div in which to display the figure. Where you call this function will determine where the figure will appear within the layout of the app. The
id
parameter you provide will be used to link to other parts of the Shiny app.
Define a function within the
server()
function that creates the figure.
The name of the function should be the same value you passed into the
id
parameter in your
ui.output_plot()
function call in the UI.
If your function calls reactive values, Shiny will update your figure whenever those values change, in a
reactive fashion
.
Your function should return one of the following objects:
A
matplotlib.figure.Figure
instance
A
matplotlib.artist.Artist
instance
A list/tuple of
Figure
/
Artist
instances
An object with a ‘figure’ attribute pointing to a
matplotlib.figure.Figure
instance
A
PIL.Image.Image
instance
Decorate your plotting function with a
@render.plot
decorator.
If your plotting function is not the same as the
id
you used in the
ui.output_plot()
, you can add an additional
@output(id=...)
decorator.
If you use the
@output()
decorator, make sure it is
above
the
@render.plot
decorator.
You can use a plot as an input widget, collecting the locations of user clicks, double clicks, hovers, and brushes. To do this, follow the instructions provided for
plots as inputs
. |
| Markdown | [](https://shiny.posit.co/py/index.html) [Shiny for Python](https://shiny.posit.co/py/index.html)
- [Get Started](https://shiny.posit.co/py/get-started/index.html)
- [Concepts](https://shiny.posit.co/py/docs/overview.html)
- [Components](https://shiny.posit.co/py/components/outputs/plot-seaborn/)
- [Components](https://shiny.posit.co/py/components/index.html)
- [Layouts](https://shiny.posit.co/py/layouts/index.html)
- [Templates](https://shiny.posit.co/py/templates/index.html)
- [Gallery](https://shiny.posit.co/py/gallery/index.html)
- [Playground](https://shinylive.io/py/examples/)
- [Reference](https://shiny.posit.co/py/components/outputs/plot-seaborn/)
- [Shiny Express](https://shiny.posit.co/py/api/express/index.html)
- [Shiny Core](https://shiny.posit.co/py/api/core/index.html)
- [Testing](https://shiny.posit.co/py/api/testing/index.html)
1. [**Outputs**](https://shiny.posit.co/py/components/outputs/data-grid/index.html)
2. [Plot (Seaborn)](https://shiny.posit.co/py/components/outputs/plot-seaborn/index.html)
- [**COMPONENTS**](https://shiny.posit.co/py/components/)
- [**Inputs**]()
- [Action Button](https://shiny.posit.co/py/components/inputs/action-button/index.html)
- [Action Link](https://shiny.posit.co/py/components/inputs/action-link/index.html)
- [Checkbox](https://shiny.posit.co/py/components/inputs/checkbox/index.html)
- [Checkbox Group](https://shiny.posit.co/py/components/inputs/checkbox-group/index.html)
- [Dark Mode Switch](https://shiny.posit.co/py/components/inputs/dark-mode/index.html)
- [Date Range Selector](https://shiny.posit.co/py/components/inputs/date-range-selector/index.html)
- [Date Selector](https://shiny.posit.co/py/components/inputs/date-selector/index.html)
- [File Input](https://shiny.posit.co/py/components/inputs/file/index.html)
- [Numeric Input](https://shiny.posit.co/py/components/inputs/numeric-input/index.html)
- [Password Field](https://shiny.posit.co/py/components/inputs/password-field/index.html)
- [Radio Buttons](https://shiny.posit.co/py/components/inputs/radio-buttons/index.html)
- [Select (Single)](https://shiny.posit.co/py/components/inputs/select-single/index.html)
- [Select (Multiple)](https://shiny.posit.co/py/components/inputs/select-multiple/index.html)
- [Selectize (Single)](https://shiny.posit.co/py/components/inputs/selectize-single/index.html)
- [Selectize (Multiple)](https://shiny.posit.co/py/components/inputs/selectize-multiple/index.html)
- [Slider](https://shiny.posit.co/py/components/inputs/slider/index.html)
- [Slider Range](https://shiny.posit.co/py/components/inputs/slider-range/index.html)
- [Switch](https://shiny.posit.co/py/components/inputs/switch/index.html)
- [Text Area](https://shiny.posit.co/py/components/inputs/text-area/index.html)
- [Text Box](https://shiny.posit.co/py/components/inputs/text-box/index.html)
- [Toolbar Button](https://shiny.posit.co/py/components/inputs/toolbar-button/index.html)
- [Toolbar Select](https://shiny.posit.co/py/components/inputs/toolbar-select/index.html)
- [**Outputs**]()
- [Data Grid](https://shiny.posit.co/py/components/outputs/data-grid/index.html)
- [Data Table](https://shiny.posit.co/py/components/outputs/data-table/index.html)
- [Image](https://shiny.posit.co/py/components/outputs/image/index.html)
- [Map (ipyleaflet)](https://shiny.posit.co/py/components/outputs/map-ipyleaflet/index.html)
- [Plot (Matplotlib)](https://shiny.posit.co/py/components/outputs/plot-matplotlib/index.html)
- [Plot (Plotly)](https://shiny.posit.co/py/components/outputs/plot-plotly/index.html)
- [Plot (Seaborn)](https://shiny.posit.co/py/components/outputs/plot-seaborn/index.html)
- [Text](https://shiny.posit.co/py/components/outputs/text/index.html)
- [UI](https://shiny.posit.co/py/components/outputs/ui/index.html)
- [Value Box](https://shiny.posit.co/py/components/outputs/value-box/index.html)
- [Verbatim Text](https://shiny.posit.co/py/components/outputs/verbatim-text/index.html)
- [**Display Messages**]()
- [Chat](https://shiny.posit.co/py/components/display-messages/chat/index.html)
- [Modal](https://shiny.posit.co/py/components/display-messages/modal/index.html)
- [Notifications](https://shiny.posit.co/py/components/display-messages/notifications/index.html)
- [Progress Bar](https://shiny.posit.co/py/components/display-messages/progress-bar/index.html)
- [Tooltips](https://shiny.posit.co/py/components/display-messages/tooltips/index.html)
- [**Layout**]()
- [Card](https://shiny.posit.co/py/components/layout/cards/index.html)
- [Toolbar](https://shiny.posit.co/py/components/layout/toolbar/index.html)
1. [**Outputs**](https://shiny.posit.co/py/components/outputs/data-grid/index.html)
2. [Plot (Seaborn)](https://shiny.posit.co/py/components/outputs/plot-seaborn/index.html)
# Plot (Seaborn)
```
```
- [Express]()
- [Core]()
```
```
```
```
No matching items
## Relevant Functions
- [ui.output\_plot](https://shiny.posit.co/py/api/ui.output_plot.html)
`ui.output_plot(id, width='100%', height='400px', *, inline=False, click=False, dblclick=False, hover=False, brush=False, fill=MISSING)`
- [@render.plot](https://shiny.posit.co/py/api/render.plot.html)
`render.plot(_fn=None, *, alt=None, width=MISSING, height=MISSING, **kwargs)`
No matching items
## Details
Seaborn is a statistical plotting library that builds on top of Matplotlib.
Follow these steps to display a Seaborn figure in your app:
1. Add `ui.output_plot()` to the UI of your app to create a div in which to display the figure. Where you call this function will determine where the figure will appear within the layout of the app. The `id` parameter you provide will be used to link to other parts of the Shiny app.
2. Define a function within the `server()` function that creates the figure.
- The name of the function should be the same value you passed into the `id` parameter in your `ui.output_plot()` function call in the UI.
- If your function calls reactive values, Shiny will update your figure whenever those values change, in a [reactive fashion](https://shiny.posit.co/py/docs/reactive-programming.html).
- Your function should return one of the following objects:
- A `matplotlib.figure.Figure` instance
- A `matplotlib.artist.Artist` instance
- A list/tuple of `Figure`/`Artist` instances
- An object with a ‘figure’ attribute pointing to a `matplotlib.figure.Figure` instance
- A `PIL.Image.Image` instance
3. Decorate your plotting function with a `@render.plot` decorator.
- If your plotting function is not the same as the `id` you used in the `ui.output_plot()`, you can add an additional `@output(id=...)` decorator.
- If you use the `@output()` decorator, make sure it is **above** the `@render.plot` decorator.
You can use a plot as an input widget, collecting the locations of user clicks, double clicks, hovers, and brushes. To do this, follow the instructions provided for [plots as inputs](https://shiny.posit.co/py/components/outputs/plot-seaborn/plot-matplotlib.html#plots-as-inputs).
[Plot (Plotly)](https://shiny.posit.co/py/components/outputs/plot-plotly/index.html)
[Text](https://shiny.posit.co/py/components/outputs/text/index.html)
Proudly supported by [](https://www.posit.co/) |
| Readable Markdown | ```
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| components: [viewer]
#| viewerHeight: 500
import seaborn as sns
from palmerpenguins import load_penguins
from shiny import App, render, ui
penguins = load_penguins()
app_ui = ui.page_fluid(
ui.input_slider("n", "Number of bins", 1, 100, 20),
ui.output_plot("plot"),
)
def server(input, output, session):
@render.plot(alt="A Seaborn histogram on penguin body mass in grams.")
def plot():
ax = sns.histplot(data=penguins, x="body_mass_g", bins=input.n())
ax.set_title("Palmer Penguins")
ax.set_xlabel("Mass (g)")
ax.set_ylabel("Count")
return ax
app = App(app_ui, server, debug=True)
```
- [Express]()
- [Core]()
```
import seaborn as sns
from palmerpenguins import load_penguins
from shiny.express import input, render, ui
penguins = load_penguins()
ui.input_slider("n", "Number of bins", 1, 100, 20)
@render.plot(alt="A Seaborn histogram on penguin body mass in grams.")
def plot():
ax = sns.histplot(data=penguins, x="body_mass_g", bins=input.n())
ax.set_title("Palmer Penguins")
ax.set_xlabel("Mass (g)")
ax.set_ylabel("Count")
return ax
```
```
import seaborn as sns
from palmerpenguins import load_penguins
from shiny import App, render, ui
penguins = load_penguins()
app_ui = ui.page_fluid(
ui.input_slider("n", "Number of bins", 1, 100, 20),
ui.output_plot("plot"),
)
def server(input, output, session):
@render.plot(alt="A Seaborn histogram on penguin body mass in grams.")
def plot():
ax = sns.histplot(data=penguins, x="body_mass_g", bins=input.n())
ax.set_title("Palmer Penguins")
ax.set_xlabel("Mass (g)")
ax.set_ylabel("Count")
return ax
app = App(app_ui, server, debug=True)
```
No matching items
## Relevant Functions
- [ui.output\_plot](https://shiny.posit.co/py/api/ui.output_plot.html)
`ui.output_plot(id, width='100%', height='400px', *, inline=False, click=False, dblclick=False, hover=False, brush=False, fill=MISSING)`
- [@render.plot](https://shiny.posit.co/py/api/render.plot.html)
`render.plot(_fn=None, *, alt=None, width=MISSING, height=MISSING, **kwargs)`
No matching items
## Details
Seaborn is a statistical plotting library that builds on top of Matplotlib.
Follow these steps to display a Seaborn figure in your app:
1. Add `ui.output_plot()` to the UI of your app to create a div in which to display the figure. Where you call this function will determine where the figure will appear within the layout of the app. The `id` parameter you provide will be used to link to other parts of the Shiny app.
2. Define a function within the `server()` function that creates the figure.
- The name of the function should be the same value you passed into the `id` parameter in your `ui.output_plot()` function call in the UI.
- If your function calls reactive values, Shiny will update your figure whenever those values change, in a [reactive fashion](https://shiny.posit.co/py/docs/reactive-programming.html).
- Your function should return one of the following objects:
- A `matplotlib.figure.Figure` instance
- A `matplotlib.artist.Artist` instance
- A list/tuple of `Figure`/`Artist` instances
- An object with a ‘figure’ attribute pointing to a `matplotlib.figure.Figure` instance
- A `PIL.Image.Image` instance
3. Decorate your plotting function with a `@render.plot` decorator.
- If your plotting function is not the same as the `id` you used in the `ui.output_plot()`, you can add an additional `@output(id=...)` decorator.
- If you use the `@output()` decorator, make sure it is **above** the `@render.plot` decorator.
You can use a plot as an input widget, collecting the locations of user clicks, double clicks, hovers, and brushes. To do this, follow the instructions provided for [plots as inputs](https://shiny.posit.co/py/components/outputs/plot-seaborn/plot-matplotlib.html#plots-as-inputs). |
| Shard | 70 (laksa) |
| Root Hash | 17512250694148690070 |
| Unparsed URL | co,posit!shiny,/py/components/outputs/plot-seaborn/ s443 |