Built-in (2024)

Python > Fundamentals > Built-in Continuous Color Scales

A reference for the built-in named continuous (sequential, diverging and cyclical) color scales in Plotly.


New to Plotly?

Plotly is a free and open-source graphing library for Python. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.

Using Built-In Continuous Color Scales

Many Plotly Express functions accept a color_continuous_scale argument and many tracetypes have a colorscale attribute in their schema. Plotly comes with a large number ofbuilt-in continuous color scales, which can be referred to in Python code when setting the above arguments,either by name in a case-insensitive string e.g. px.scatter(color_continuous_scale="Viridis") or by reference e.g.go.Scatter(marker_colorscale=plotly.colors.sequential.Viridis). They can also be reversed by adding _r at the ende.g. "Viridis_r" or plotly.colors.sequential.Viridis_r.

The plotly.colours module is also available under plotly.express.colors so you can refer to it as px.colors.

When using continuous color scales, you will often want to configure various aspects of its range and colorbar.

Discrete Color Sequences

Plotly also comes with some built-in discrete color sequences which are not intended to be used with the color_continuous_scale argument as they are not designed for interpolation to occur between adjacent colors.

Named Built-In Continuous Color Scales

You can use any of the following names as string values to set continuous_color_scale or colorscale arguments.These strings are case-insensitive and you can append _r to them to reverse the order of the scale.

In[1]:

import plotly.express as pxfrom textwrap import wrapnamed_colorscales = px.colors.named_colorscales()print("\n".join(wrap("".join('{:<12}'.format(c) for c in named_colorscales), 96)))
aggrnyl agsunset blackbody bluered blues blugrn bluyl brwnylbugn bupu burg burgyl cividis darkmint electric emrldgnbu greens greys hot inferno jet magenta magmamint orrd oranges oryel peach pinkyl plasma plotly3pubu pubugn purd purp purples purpor rainbow rdburdpu redor reds sunset sunsetdark teal tealgrn turboviridis ylgn ylgnbu ylorbr ylorrd algae amp deepdense gray haline ice matter solar speed tempothermal turbid armyrose brbg earth fall geyser prgnpiyg picnic portland puor rdgy rdylbu rdylgn spectraltealrose temps tropic balance curl delta oxy edgehsv icefire phase twilight mrybm mygbm

Built-in color scales are stored as lists of CSS colors:

In[2]:

import plotly.express as pxprint(px.colors.sequential.Plasma)
['#0d0887', '#46039f', '#7201a8', '#9c179e', '#bd3786', '#d8576b', '#ed7953', '#fb9f3a', '#fdca26', '#f0f921']

Continuous Color Scales in Dash

Dash is the best way to build analytical apps in Python using Plotly figures. To run the app below, run pip install dash, click "Download" to get the code and run python app.py.

Get started with the official Dash docs and learn how to effortlessly style & deploy apps like this with Dash Enterprise.

Out[3]:

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.Join now.

Built-In Sequential Color scales

A collection of predefined sequential colorscales is provided in the plotly.colors.sequential module. Sequential color scales are appropriate for most continuous data, but in some cases it can be helpful to use a diverging or cyclical color scale (see below).

Here are all the built-in scales in the plotly.colors.sequential module:

In[4]:

import plotly.express as pxfig = px.colors.sequential.swatches_continuous()fig.show()

Note: RdBu was included in the sequential module by mistake, even though it is a diverging color scale.It is intentionally left in for backwards-compatibility reasons.

Built-In Diverging Color scales

A collection of predefined diverging color scales is provided in the plotly.colors.diverging module.Diverging color scales are appropriate for continuous data that has a natural midpointother otherwise informative special value, such as 0 altitude, or the boiling pointof a liquid. These scales are intended to be used when explicitly setting the midpoint of the scale.

Here are all the built-in scales in the plotly.colors.diverging module:

In[5]:

import plotly.express as pxfig = px.colors.diverging.swatches_continuous()fig.show()

Built-In Cyclical Color scales

A collection of predefined cyclical color scales is provided in the plotly.colors.cyclical module.Cyclical color scales are appropriate for continuous data that has a natural cyclicalstructure, such as temporal data (hour of day, day of week, day of year, seasons) orcomplex numbers or other phase or angular data.

Here are all the built-in scales in the plotly.colors.cyclical module:

In[6]:

import plotly.express as pxfig = px.colors.cyclical.swatches_cyclical()fig.show()fig = px.colors.cyclical.swatches_continuous()fig.show()

What About Dash?

Dash is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.

Learn about how to install Dash at https://dash.plot.ly/installation.

Everywhere in this page that you see fig.show(), you can display the same figure in a Dash application by passing it to the figure argument of the Graph component from the built-in dash_core_components package like this:

import plotly.graph_objects as go # or plotly.express as pxfig = go.Figure() # or any Plotly Express function e.g. px.bar(...)# fig.add_trace( ... )# fig.update_layout( ... )from dash import Dash, dcc, htmlapp = Dash()app.layout = html.Div([ dcc.Graph(figure=fig)])app.run_server(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter
Built-in (2)
Built-in (2024)

FAQs

What does built-in do? ›

Built In is creating the largest candidate generation platform for technology professionals, engaging millions of the industry's most in-demand professionals from around the world.

Are there still remote tech jobs? ›

If there's any industry in which you can expect to find the highest percentage of remote jobs hiring at a consistent level, it's the tech industry. This is in part, thanks to the heavily digital nature of these roles which enable remote tools to be used anywhere.

What are the best tech companies in the world? ›

Big Five. Alphabet, Amazon, Apple, Meta, and Microsoft are known as the Big Five tech companies. They were known as GAFAM before Facebook changed its name to Meta in 2021. They are among the most valuable public companies.

What do you mean by built in? ›

adjective. built so as to be an integral and permanent part of a larger construction: The wall has a built-in bookcase. existing as a natural or characteristic part of something; inherent: a built-in contempt for daydreaming.

What is the best meaning of built in? ›

Answer: A built-in best friend is a special edition best friend friendship. The relationship may be somewhat similar to other best friend scenarios. But what makes it just a little different is that you are already bound to this individual for another separate reason.

Is remote work dying out? ›

Does that mean the era of “ Work From Home “ (WFH) is finally and undeniably over? Perhaps not yet. The Era of Remote Work May Not Be Over YetAccording to a 2023 report by the US Census Bureau, the number of people working from their home offices went from about 9 million in 2019 to 28 million by 2021.

What company is 100% remote? ›

X-Team is a 100% remote international company, originally founded in Melbourne, Australia. We help companies scale their development teams by providing them with extraordinary teams of developers from around the world.

Is Amazon still fully remote? ›

In February, Amazon decided to ditch its WFH policy by asking all workers to return to the office for at least three days a week, starting from May 1.

Why are companies stopping remote work? ›

While working remotely offers advantages, in-office work can be healthier for some employees in a few ways: Social Connection and Belonging. Physical presence with colleagues fosters friendships, a sense of community, and combats feelings of isolation. Clearer Work-Life Separation.

What is the most trusted tech company? ›

Winners: The tech companies with the highest Reputational Quotient, or RQ®, scores, were Samsung (81), Amazon (80.7) and Apple (80.6), which retained their 2022 position. Sony (79.8), Microsoft (79.7), and LG (78.8) also landed in the top 20.

Who is the richest big tech company? ›

As of June 5, 2024, Microsoft was the leading tech company by market capitalization globally at 3.15 trillion U.S. dollars. For the first time, Nvidia surpassed the three trillion U.S. dollar mark, overtaking Apple on June 5, 2024, to take second place in the rankings.

What is the most prestigious tech company to work for? ›

1. Microsoft: This tech giant offers a comprehensive benefits package, ample learning and development opportunities, and a strong focus on work-life balance. With diverse teams and a commitment to inclusion, Microsoft attracts top talent across various technical and non-technical roles.

What is the function of built in? ›

A built-in function is a function that is already available in a programming language, application, or another tool that can be accessed by end users. For example, most spreadsheet applications support a built-in SUM function that adds up all cells in a row or column.

Should I do built-ins? ›

Should you install built-ins? Built-ins are incredibly versatile and varied, and they're a great addition to your home if you're looking to optimize space and storage. “Built-ins can be a no-brainer for that space in your home that you continually ask yourself what to do with it,” Horner says.

What does built in mean in coding? ›

Built-in functions refer to those pre-defined functions that come along with a programming language. They are intrinsic components of the language's library, ready to be used without requiring any additional installation or importation.

What does built in mean in software? ›

Computer programs that are built into a computer and available automatically when the computer is switched on. Examples include the word processors, spreadsheets, and graphics programs that are built into most desktop terminals. From: built-in software in A Dictionary of Business and Management »

Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 5728

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.