![]() |
健身的键盘 · Python Docker IMAGE 的挑选· 5 天前 · |
![]() |
英俊的大葱 · 优化 Python 应用容器镜像构建 - 三水言己· 5 天前 · |
![]() |
强悍的梨子 · python ...· 3 天前 · |
![]() |
幸福的柳树 · 获取视频剪辑的最后一帧,并使用moviepy ...· 4 小时前 · |
![]() |
腼腆的柠檬 · moviepy库实现图片由屏幕由慢到快滑入效 ...· 4 小时前 · |
![]() |
千杯不醉的红豆 · 红牛老板马特希茨丨用一罐饮料建立起体育王国, ...· 8 月前 · |
![]() |
爱玩的馒头 · 安卓和苹果用户都能免费享用51吃瓜网站 - 渣玉吻· 8 月前 · |
![]() |
小眼睛的充值卡 · WPF - 代码动态更换按钮的背景图片 - ...· 1 年前 · |
![]() |
满身肌肉的野马 · reactjs - How to ...· 1 年前 · |
![]() |
火星上的紫菜汤 · Malawi Media Freedom ...· 1 年前 · |
flask django python |
https://www.geeksforgeeks.org/built-in-continuous-color-scales-in-python-plotly/ |
![]() |
俊逸的柠檬
1 年前 |
Plotly has built-in discrete and continuous color scales. This article is about discrete color scales. A color continuous scale input is accepted by several Plotly Express functions, and many trace types have a color scale property in their schema. Plotly has a wide variety of built-in continuous color scales that can be referenced in Python code when specifying the arguments, either by name or by reference.
Code to print out the names of the color scales:
[‘aggrnyl’, ‘agsunset’, ‘blackbody’, ‘bluered’, ‘blues’, ‘blugrn’, ‘bluyl’, ‘brwnyl’, ‘bugn’, ‘bupu’,’burg’, ‘burgyl’, ‘cividis’, ‘darkmint’, ‘electric’, ’emrld’, ‘gnbu’, ‘greens’, ‘greys’, ‘hot’, ‘inferno’,’jet’, ‘magenta’, ‘magma’, ‘mint’, ‘orrd’, ‘oranges’, ‘oryel’, ‘peach’, ‘pinkyl’, ‘plasma’, ‘plotly3′,’pubu’, ‘pubugn’, ‘purd’, ‘purp’, ‘purples’, ‘purpor’, ‘rainbow’, ‘rdbu’, ‘rdpu’, ‘redor’, ‘reds’,’sunset’, ‘sunsetdark’, ‘teal’, ‘tealgrn’, ‘turbo’, ‘viridis’, ‘ylgn’, ‘ylgnbu’, ‘ylorbr’, ‘ylorrd’,’algae’, ‘amp’, ‘deep’, ‘dense’, ‘gray’, ‘haline’, ‘ice’, ‘matter’, ‘solar’, ‘speed’, ‘tempo’, ‘thermal’,’turbid’, ‘armyrose’, ‘brbg’, ‘earth’, ‘fall’, ‘geyser’, ‘prgn’, ‘piyg’, ‘picnic’, ‘portland’, ‘puor’,’rdgy’, ‘rdylbu’, ‘rdylgn’, ‘spectral’, ‘tealrose’, ‘temps’, ‘tropic’, ‘balance’, ‘curl’, ‘delta’, ‘oxy’, ‘edge’, ‘hsv’, ‘icefire’, ‘phase’, ‘twilight’, ‘mrybm’, ‘mygbm’]
Code to view the built-in sequential color scales in plotly.colors.sequential module. Swatches_sequential() method is used to view the color scales. The method returns a plot of all sequential color scales:
# import packages and libraries
import
pandas as pd
from
matplotlib
import
pyplot as plt
import
numpy as np
import
plotly.express as px
# reading the dataset
df
=
pd.read_csv(
'weather.csv'
, encoding
=
'UTF-8'
)
# plot a scatterplot
fig
=
px.scatter(df, x
=
"Temperature"
, y
=
'Humidity'
, color
=
'Light'
,
title
=
"Numeric 'size' values represents continuous color"
)
fig.show()
|
# import packages and libraries
import
pandas as pd
from
matplotlib
import
pyplot as plt
import
numpy as np
import
plotly.express as px
# reading the dataset
df
=
pd.read_csv(
'weather.csv'
, encoding
=
'UTF-8'
)
# creating a scatterplot
fig
=
px.scatter(df, x
=
"Temperature"
, y
=
'Humidity'
, color
=
'Light'
,
color_continuous_scale
=
px.colors.sequential.Rainbow)
fig.show()
|
# import packages and libraries
import
pandas as pd
from
matplotlib
import
pyplot as plt
import
numpy as np
import
plotly.express as px
# reading the dataset
df
=
pd.read_csv(
'weather.csv'
, encoding
=
'UTF-8'
)
# creating a scatterplot
fig
=
px.scatter(df, x
=
"Temperature"
, y
=
'Humidity'
, color
=
'Light'
,
color_continuous_scale
=
'Viridis'
)
fig.show()
|
![]() |
健身的键盘 · Python Docker IMAGE 的挑选 5 天前 |
![]() |
英俊的大葱 · 优化 Python 应用容器镜像构建 - 三水言己 5 天前 |
![]() |
幸福的柳树 · 获取视频剪辑的最后一帧,并使用moviepy扩展10个场景 - 4 小时前 |
![]() |
腼腆的柠檬 · moviepy库实现图片由屏幕由慢到快滑入效果 - 每日教程 4 小时前 |
![]() |
爱玩的馒头 · 安卓和苹果用户都能免费享用51吃瓜网站 - 渣玉吻 8 月前 |