Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Module

fig.show

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.

How it works

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.

Syntax

plotly.io.show(fig, renderer=None, validate=True, **kwargs)

Parameters

NameTypeDescription
figdict of FigureThe Figure object or figure dict to display.
rendererstr or None, default NoneRegistered renderer name or names separated by +; None uses the configured default renderers.
validatebool, default TrueWhether to validate the figure before displaying it.
widthint or floatPlot width in pixels; omitted values use the Plotly.js default.
heightint or floatPlot height in pixels; omitted values use the Plotly.js default.
configdictDictionary of parameters used to configure the figure.

Returns

None

Key points

  • The function displays a figure using either configured defaults or explicitly selected renderers.
  • The input may be a Plotly Figure object or a compatible figure dictionary.
  • Omitting the renderer delegates selection to plotly.io.renderers.default.
  • The width keyword sets the rendered plot's pixel width.
  • The height keyword sets the rendered plot's pixel height.
  • The config keyword passes a dictionary of figure-configuration options.

Common mistakes

  • A null renderer does not mean no output; it selects the renderers configured as the current default.
  • Renderer names must be registered, and multiple names are combined with +.
  • Setting validate=False skips figure validation, so malformed figure data may reach the renderer.

Example: Display a figure with a selected 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.

When to use it

Render a chart

Interactive notebook or script output

Choose a renderer

Browser, notebook, or other registered output target

Set display dimensions

Consistent presentation sizing

Configure the figure

Passing Plotly.js options

Interview questions

QWhat does 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 +.

QHow does renderer selection work?

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.

QWhich display controls are available through keyword arguments?

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.renderers
  • plotly.graph_objects.Figure.show
  • plotly.io.write_image
  • plotly.io.to_html

Source: plotly.io.show — 7.1.0 documentation. Checked 2026-10-15.