Showing Color scale
The color scale is a specialized label which helps to displays a color map with its scale, the color scale is used to display a color palette and its numerical scale for color mapped.
Example:
Python3
import plotly.graph_objects as px import numpy as np # creating random data through randomint # function of numpy.random np.random.seed( 42 ) random_x = np.random.randint( 1 , 101 , 100 ) random_y = np.random.randint( 1 , 101 , 100 ) plot = px.Figure(data = [px.Scatter( x = random_x, y = random_y, mode = 'markers' , marker = dict ( color = [ 10 , 20 , 30 , 50 ], size = [ 10 , 30 , 50 , 80 ], showscale = True ) )]) plot.show() |
Output:
Bubble chart using Plotly in Python
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.