MCPcopy Index your code
hub / github.com/plotly/plotly.py / show

Function show

plotly/io/_renderers.py:369–424  ·  view source on GitHub ↗

Show a figure using either the default renderer(s) or the renderer(s) specified by the renderer argument Parameters ---------- fig: dict of Figure The Figure object or figure dict to display renderer: str or None (default None) A string containing the names

(fig, renderer=None, validate=True, **kwargs)

Source from the content-addressed store, hash-verified

367
368# Show
369def show(fig, renderer=None, validate=True, **kwargs):
370 """
371 Show a figure using either the default renderer(s) or the renderer(s)
372 specified by the renderer argument
373
374 Parameters
375 ----------
376 fig: dict of Figure
377 The Figure object or figure dict to display
378
379 renderer: str or None (default None)
380 A string containing the names of one or more registered renderers
381 (separated by '+' characters) or None. If None, then the default
382 renderers specified in plotly.io.renderers.default are used.
383
384 validate: bool (default True)
385 True if the figure should be validated before being shown,
386 False otherwise.
387
388 width: int or float
389 An integer or float that determines the number of pixels wide the
390 plot is. The default is set in plotly.js.
391
392 height: int or float
393 An integer or float specifying the height of the plot in pixels.
394 The default is set in plotly.js.
395
396 config: dict
397 A dict of parameters to configure the figure. The defaults are set
398 in plotly.js.
399
400 Returns
401 -------
402 None
403 """
404 fig_dict = validate_coerce_fig_to_dict(fig, validate)
405
406 # Mimetype renderers
407 bundle = renderers._build_mime_bundle(fig_dict, renderers_string=renderer, **kwargs)
408 if bundle:
409 if not ipython_display:
410 raise ValueError(
411 "Mime type rendering requires ipython but it is not installed"
412 )
413
414 if not nbformat or Version(nbformat.__version__) < Version("4.2.0"):
415 raise ValueError(
416 "Mime type rendering requires nbformat>=4.2.0 but it is not installed"
417 )
418
419 display_jupyter_version_warnings()
420
421 ipython_display.display(bundle, raw=True)
422
423 # external renderers
424 renderers._perform_external_rendering(fig_dict, renderers_string=renderer, **kwargs)
425
426

Callers

nothing calls this directly

Tested by

no test coverage detected