Skip to content

Merge recent docs changes back to main #5171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e17947b
Merge pull request #5093 from plotly/update-live-docs
LiamConnors Mar 17, 2025
9a26a63
Add rename
LiamConnors Mar 20, 2025
3763b5f
Merge pull request #5103 from plotly/add-rename
LiamConnors Mar 21, 2025
591f6a9
Remove deprecated append_trace from docs
LiamConnors Apr 3, 2025
a50bc3e
remove deprecated append_trace
LiamConnors Apr 3, 2025
7d62668
Merge pull request #5125 from plotly/remove-deprecated-param
LiamConnors Apr 8, 2025
7a230fb
Create supported-colors.md
LiamConnors Apr 9, 2025
5040be6
Update supported-colors.md
LiamConnors Apr 9, 2025
8b166bd
Update supported-colors.md
LiamConnors Apr 9, 2025
7a4ffa4
Update supported-colors.md
LiamConnors Apr 9, 2025
a07705a
Update supported-colors.md
LiamConnors Apr 9, 2025
79a0e0e
Update doc/python/supported-colors.md
LiamConnors Apr 10, 2025
c8b38f4
Update doc/python/supported-colors.md
LiamConnors Apr 10, 2025
2c649d2
corrected a label from Canada to Oceania
rl-utility-man Apr 12, 2025
e7a4bb7
Merge pull request #5140 from rl-utility-man/patch-11
LiamConnors Apr 14, 2025
80d473e
Merge pull request #5137 from plotly/add-colors
LiamConnors Apr 16, 2025
5a9b1fb
Applying changes that #4994 made to "main" to "doc-prod"
rl-utility-man Apr 18, 2025
9c859a5
Merge pull request #5148 from rl-utility-man/patch-12
LiamConnors Apr 22, 2025
e5acbd9
Update tile-scatter-maps.md
LiamConnors Apr 30, 2025
3182d49
Merge pull request #5159 from plotly/update-symbols
LiamConnors Apr 30, 2025
e6d859a
Fix incorrect link
LiamConnors May 7, 2025
0026a09
Merge pull request #5170 from plotly/LiamConnors-patch-3
LiamConnors May 7, 2025
0e20fff
Merge branch 'main' into updates-for-main
LiamConnors May 7, 2025
3611046
Update supported-colors.md
LiamConnors May 7, 2025
04203fa
Merge branch 'updates-for-main' of https://github.com/plotly/plotly.p…
LiamConnors May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ commands:
source .venv/bin/activate
uv pip install .
uv pip install -r ./test_requirements/requirements_optional.txt

- when:
condition:
condition:
not:
equal:
- <<parameters.pandas_version>>
Expand Down Expand Up @@ -347,6 +347,8 @@ jobs:
name: Install dependencies
command: |
cd doc
sudo apt-get update
sudo apt-get install rename
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion doc/python/bar-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import plotly.express as px
df = px.data.gapminder().query("continent == 'Oceania'")
fig = px.bar(df, x='year', y='pop',
hover_data=['lifeExp', 'gdpPercap'], color='country',
labels={'pop':'population of Canada'}, height=400)
labels={'pop':'population of Oceania'}, height=400)
fig.show()
```

Expand Down
142 changes: 142 additions & 0 deletions doc/python/supported-colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.17.0
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
codemirror_mode:
name: ipython
version: 3
file_extension: .py
mimetype: text/x-python
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.13.2
plotly:
description: A list of supported named CSS Colors
display_as: file_settings
language: python
layout: base
name: Supported CSS Colors
order: 41
page_type: example_index
permalink: python/css-colors/
thumbnail: thumbnail/shape.jpg
---

# Supported CSS Colors

Many properties in Plotly.py for configuring colors support named CSS colors. For example, marker colors:

```python
import plotly.graph_objects as go

fig = go.Figure([
go.Bar(
x=['Jan', 'Feb', 'Mar', 'Apr'],
y=[20, 14, 25, 16],
name='Primary Product',
# Named CSS color
marker_color='royalblue'
)
])

fig.show()
```

These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color).

```python hide_code=true
import plotly.graph_objects as go
import pandas as pd

supported_colors = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
"beige", "bisque", "black", "blanchedalmond", "blue",
"blueviolet", "brown", "burlywood", "cadetblue",
"chartreuse", "chocolate", "coral", "cornflowerblue",
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan",
"darkgoldenrod", "darkgray", "darkgrey", "darkgreen",
"darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
"darkorchid", "darkred", "darksalmon", "darkseagreen",
"darkslateblue", "darkslategray", "darkslategrey",
"darkturquoise", "darkviolet", "deeppink", "deepskyblue",
"dimgray", "dimgrey", "dodgerblue", "firebrick",
"floralwhite", "forestgreen", "fuchsia", "gainsboro",
"ghostwhite", "gold", "goldenrod", "gray", "grey", "green",
"greenyellow", "honeydew", "hotpink", "indianred", "indigo",
"ivory", "khaki", "lavender", "lavenderblush", "lawngreen",
"lemonchiffon", "lightblue", "lightcoral", "lightcyan",
"lightgoldenrodyellow", "lightgray", "lightgrey",
"lightgreen", "lightpink", "lightsalmon", "lightseagreen",
"lightskyblue", "lightslategray", "lightslategrey",
"lightsteelblue", "lightyellow", "lime", "limegreen",
"linen", "magenta", "maroon", "mediumaquamarine",
"mediumblue", "mediumorchid", "mediumpurple",
"mediumseagreen", "mediumslateblue", "mediumspringgreen",
"mediumturquoise", "mediumvioletred", "midnightblue",
"mintcream", "mistyrose", "moccasin", "navajowhite", "navy",
"oldlace", "olive", "olivedrab", "orange", "orangered",
"orchid", "palegoldenrod", "palegreen", "paleturquoise",
"palevioletred", "papayawhip", "peachpuff", "peru", "pink",
"plum", "powderblue", "purple", "red", "rosybrown",
"royalblue", "rebeccapurple", "saddlebrown", "salmon",
"sandybrown", "seagreen", "seashell", "sienna", "silver",
"skyblue", "slateblue", "slategray", "slategrey", "snow",
"springgreen", "steelblue", "tan", "teal", "thistle", "tomato",
"turquoise", "violet", "wheat", "white", "whitesmoke",
"yellow", "yellowgreen"]

fig = go.Figure(layout=dict(title="Supported Named CSS Colors"))

for i, color in enumerate(supported_colors):
row, col = i // 5, i % 5
x0, y0 = col * 1.2, -row * 1.2

fig.add_shape(
type="rect",
x0=x0, y0=y0,
x1=x0+1, y1=y0+1,
fillcolor=color,
line=dict(color="black", width=0.2),
)

fig.add_annotation(
x=x0+0.5, y=y0-0.1,
text=color,
showarrow=False,
font=dict(size=10)
)

fig.update_layout(
height=((len(supported_colors) // 5) + (1 if len(supported_colors) % 5 else 0)) * 120,
width=800,
showlegend=False,
plot_bgcolor='rgba(0,0,0,0)',
margin=dict(l=50, r=50, t=50, b=50),
xaxis=dict(
showgrid=False,
zeroline=False,
showticklabels=False,
range=[-0.5, 6]
),
yaxis=dict(
showgrid=False,
zeroline=False,
showticklabels=False,
scaleanchor="x",
scaleratio=1,
range=[-((len(supported_colors) // 5) + 1) * 1.2, 1.5]
)
)

fig.show()
```
10 changes: 1 addition & 9 deletions doc/python/tile-scatter-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,6 @@ fig.show()

You can define the symbol on your map by setting [`symbol`](https://plotly.com/python/reference/scattermap/#scattermap-marker-symbol) attribute.

- basic
- streets
- outdoors
- light
- dark
- satellite
- satellite-streets

```python
import plotly.graph_objects as go

Expand Down Expand Up @@ -356,6 +348,6 @@ fig.show()

#### Reference

See [function reference for `px.scatter_map`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermap/ for more information about the attributes available.
See [function reference for `px.scatter_map`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_map) or https://plotly.com/python/reference/scattermap/ for more information about the attributes available.

For Mapbox-based tile maps, see [function reference for `px.scatter_mapbox`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermapbox/.