Render a chart
Interactive notebook or script output
Plotly · Module
Displays a Plotly Figure or figure dictionary through the default renderer or one or more selected registered renderers. Validation is enabled by default, and display options such as dimensions and configuration can be passed as keyword arguments.
plotly.io.show displays a Plotly Figure or figure dictionary through one or more registered renderers. Leaving renderer as None uses the configured default; validation is enabled by default, and keyword options such as width, height, and config control the displayed result.
plotly.io.show(fig, renderer=None, validate=True, **kwargs)| Name | Type | Description |
|---|---|---|
fig | dict of Figure | The Figure object or figure dict to display. |
renderer | str or None, default None | Registered renderer name or names separated by +; None uses the configured default renderers. |
validate | bool, default True | Whether to validate the figure before displaying it. |
width | int or float | Plot width in pixels; omitted values use the Plotly.js default. |
height | int or float | Plot height in pixels; omitted values use the Plotly.js default. |
config | dict | Dictionary of parameters used to configure the figure. |
None
plotly.io.renderers.default.width keyword sets the rendered plot's pixel width.height keyword sets the rendered plot's pixel height.config keyword passes a dictionary of figure-configuration options.+.validate=False skips figure validation, so malformed figure data may reach the renderer.import plotly.express as px
fig = px.bar(x=["A", "B", "C"], y=[2, 1, 3], title="Sales")
fig.show(renderer="browser", width=700, height=450)Creates a bar chart and displays it in the browser renderer with explicit pixel dimensions.
Interactive notebook or script output
Browser, notebook, or other registered output target
Consistent presentation sizing
Passing Plotly.js options
plotly.io.show do and what does it return?It accepts a Figure object or figure dictionary and displays it through the default renderer or a renderer selected by renderer. It returns None.
Follow-up: How can several renderers be selected? Pass their registered names in one string separated by +.
renderer=None uses plotly.io.renderers.default. Supplying a renderer string temporarily chooses one or more registered renderers for that call.
Follow-up: What happens when no renderer is supplied? The configured default renderer set is used.
The validate parameter defaults to True and controls whether the figure is validated before display. width and height specify pixel dimensions, while config supplies figure configuration parameters.
Follow-up: What are the default dimensions? They are determined by Plotly.js when width and height are omitted.
plotly.io.renderersplotly.graph_objects.Figure.showplotly.io.write_imageplotly.io.to_html