Presenting Scatter with a Color Dimension
Color scale can be shown using the showscale parameter. This parameter takes a boolean value. If the value is true then the scale is shown otherwise not.
Example:
Python3
import plotly.graph_objects as go import numpy as np n = 10000 plot = go.Figure(data = [go.Scatter( x = np.random.randn(n), mode = 'markers' , marker = dict ( color = np.random.randn(n), colorscale = 'Viridis' , showscale = True ) ) ]) plot.show() |
Output:
Scatter plot in Plotly using graph_objects class
Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.