4 min read•july 30, 2024
is a powerful Python library for creating interactive, web-based visualizations. It offers a wide range of chart types and customization options, allowing you to create stunning, publication-quality graphs that users can interact with directly in their web browsers.
With Plotly, you can easily add to your visualizations, create animations, and even build dynamic dashboards. This makes it an essential tool for data scientists and analysts who want to create engaging, exploratory data visualizations that can be easily shared and embedded in web pages.
go.Scatter
function with mode='lines'
{'x': [1, 2, 3], 'y': [4, 5, 6]}
go.Bar
function
{'x': ['A', 'B', 'C'], 'y': [10, 20, 30]}
go.Scatter
function with mode='markers'
{'x': [1, 2, 3], 'y': [4, 5, 6], 'marker': {'color': 'red', 'size': 10, 'symbol': 'circle'}}
{'title': 'My Plot', 'xaxis': {'title': 'X Axis'}, 'yaxis': {'title': 'Y Axis'}}
[make_subplots](https://www.fiveableKeyTerm:make_subplots)
function
[hoverinfo](https://www.fiveableKeyTerm:hoverinfo)
, [hovertext](https://www.fiveableKeyTerm:hovertext)
, and [hovertemplate](https://www.fiveableKeyTerm:hovertemplate)
parameters in the
{'x': [1, 2, 3], 'y': [4, 5, 6], 'hovertext': ['A', 'B', 'C']}
[on_click](https://www.fiveableKeyTerm:on_click)
, [on_hover](https://www.fiveableKeyTerm:on_hover)
, and [on_selection](https://www.fiveableKeyTerm:on_selection)
parameters[layout.xaxis.autorange](https://www.fiveableKeyTerm:layout.xaxis.autorange)
, [layout.yaxis.autorange](https://www.fiveableKeyTerm:layout.yaxis.autorange)
, and [layout.dragmode](https://www.fiveableKeyTerm:layout.dragmode)
parametersframes
parameter
[layout.updatemenus](https://www.fiveableKeyTerm:layout.updatemenus)
parameter is used to create menus that allow the user to control the animation
update
and [restyle](https://www.fiveableKeyTerm:restyle)
methods of the figure objectfig.update(data=[{'y': [1, 2, 3]}])
[FigureWidget](https://www.fiveableKeyTerm:figurewidget)
class can be used to create interactive graphs that update in response to changes in the data or layout properties
fig = go.FigureWidget(data=[{'y': [1, 2, 3]}])
iframe
elements
[write_html](https://www.fiveableKeyTerm:write_html)
methodiframe
[plotly.js](https://www.fiveableKeyTerm:plotly.js)
JavaScript library
div
element on the pageiframe
approach[dcc.Graph](https://www.fiveableKeyTerm:dcc.graph)
component