How to change a color bar in Plotly in Python Last Updated : 28 Nov, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will learn how to change a color bar in Plotly Python. Different types Color-Scale names for Plotlyaggrnyl burginferno plasma rdpu ylgnbu mattergeyseragsunset burgyl jet plotly3redorylorbr solarpiygblackbodycividismagenta pubu reds ylorrd speedpicnicblues darkmintmagmapubugn sunsetalgae tempoportlandbluered electricmintpurd sunsetdark amp thermalpuorblugrn emrldorrdpurptealdeepturbidrdgybluyl gnbuorangespurplestealgrn dense armyroserdylbubrwnylgreensoryel purporturbogray brbgrdylgnbugn greyspeachrainbow viridishaline earthspectralbupu hotpinkylrdbuylgn ice falltealrosetempstropicbalancecurldeltaoxyedgehsvicefirephasetwilightmrybmmygbm Syntax: We can change the color by using the color scale. fig = go.Figure(data=go.Scatter( y=np.random.randn(500), mode='markers', marker=dict( size=8, # set color equal to a variable color=np.random.randn(500), # one of plotly colorscales colorscale='hot', # enable color scale showscale=True ) )) Example 1: Python3 # import the modules import plotly.graph_objects as go import numpy as np # create figure # from the data using numpy random method fig = go.Figure(data=go.Scatter( y=np.random.randn(500), mode='markers', marker=dict( size=8, # set color equal to a variable color=np.random.randn(500), # one of plotly colorscales colorscale='hot', # enable color scale showscale=True ) )) # display figure fig.show() Output: Example 2: Set color to hot_r Python3 import plotly.graph_objects as go import numpy as np fig = go.Figure(data=go.Line( y = np.random.randn(500), mode='markers', marker=dict( size=8, color=np.random.randn(500), #set color equal to a variable colorscale='hot_r', # one of plotly colorscales showscale=True # enable color scale ) )) fig.show() Output: Example 3: Set color to turbo_r Python3 import plotly.graph_objects as go import numpy as np fig = go.Figure(data=go.Scatter( y=np.random.randn(500), mode='markers', marker=dict( size=8, # set color equal to a variable color=np.random.randn(550), # one of plotly colorscales colorscale='turbo_r', # enable color scale showscale=True ) )) # display fig.show() Output: Comment More infoAdvertise with us Next Article How to change a color bar in Plotly in Python skrg141 Follow Improve Article Tags : Misc Python Python-Plotly Practice Tags : Miscpython Similar Reads How to group Bar Charts in Python-Plotly? 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 2 min read How to change figure size in Plotly in Python In this article, we will discuss how we can change the figure size in Plotly in Python. Let's firstly take about Plotly in Python. Plotly  Python library provides us with an interactive open-source Plotly library that can support over 40 unique chart types that cover a wide list of statistical, fin 4 min read Change marker border color in Plotly - Python In this article, we are going to discuss how to change marker border color using plotly module in Python. Plotly is definitely a must-know tool for visualization since it's incredibly powerful easily used and has the big benefit of interactivity we are able to export visualization, being able to run 4 min read How to Change Line Color in Matplotlib? Matlab's plotting functions are included in Python by the Inclusion of the library Matplotlib. The library allows the plotting of the data of various dimensions without ambiguity in a plot. The library is widely used in Data Science and Data visualization. In this article, we will discuss how to cha 3 min read How to create Stacked bar chart in Python-Plotly? 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 2 min read Like