After that, we will describe all of the built-in renderers and discuss why you might choose to use each one.
Next, we will show how to configure the default renderer. These contexts include the classic Jupyter Notebook, JupyterLab, Visual Studio Code notebooks, Google Colaboratory, Kaggle notebooks, Azure notebooks, and the Python interactive shell.Īdditional contexts are supported by choosing a compatible renderer including the IPython console, QtConsole, Spyder, and more. In many contexts, an appropriate renderer will be chosen automatically and you will not need to perform any additional configuration. Second, plotly.py must be running from within an IPython kernel. First, the last expression in a cell must evaluate to a figure. To be precise, figures will display themselves using the current default renderer when the two following conditions are true. With either approach, plotly.py will display the figure using the current default renderer(s). show() method on a graph object figure, or pass the figure to the plotly.io.show function. To display a figure using the renderers framework, you call the. The renderers framework is a flexible approach for displaying plotly.py figures in a variety of contexts. Displaying Figures Using The renderers Framework ¶
By rendering the figure to a static image file using Kaleido such as PNG, JPEG, SVG, PDF or EPS and loading the resulting file in any viewerĮach of the first three approaches is discussed below.By exporting to an HTML file and loading that file in a browser immediately or later.Using a FigureWidget rather than a Figure in an ipywidgets context.Using the renderers framework in the context of a script or notebook (the main topic of this page).In general, there are five different approaches you can take in order to display plotly figures: Plotly's Python graphing library, plotly.py, gives you a wide range of options for how and where to display your figures.