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.

Similar Reads

Scatter plot using graph_objects class

Scatter plot are those charts in which data points are represented horizontally and on vertical axis to show that how one variable affect on another variable. The scatter() method of graph_objects class produces a scatter trace. The mode of the property decides the appearance of data points....

Presenting Scatter with a Color Dimension

...

Styling Scatter Plots

...

Bubble Scatter Plots

...