From 5014eaecbbc9858d3fba35b6524d1be52f8cc2a6 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Fri, 19 Jan 2024 15:58:21 -0500 Subject: [PATCH 1/2] Update marker-style.md --- doc/python/marker-style.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/doc/python/marker-style.md b/doc/python/marker-style.md index 21b0a2ac052..91d136bcc58 100644 --- a/doc/python/marker-style.md +++ b/doc/python/marker-style.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.14.1 + jupytext_version: 1.14.6 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.8.0 + version: 3.10.11 plotly: description: How to style markers in Python with Plotly. display_as: file_settings @@ -361,7 +361,7 @@ fig.show() ### Using a Custom Marker -To use a custom marker, set the `symbol` on the `marker`. Here we set it to `diamond`. +To use a custom marker, set the `symbol` on the `marker`. Here we set it to `diamond`. ```python @@ -378,6 +378,31 @@ fig.show() ``` +#### Open Marker Colors + +In the previous example, each marker has two colors, a marker color (set in Plotly Express with `color="species"`) and a line color (set on the line with `color="DarkSlateGrey"`. When using open markers, like `"diamond-open"` in the following example, the marker always uses only the marker color. Adding a line color won't update the marker. + +```python +import plotly.express as px + +df = px.data.iris() +fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species") + +fig.update_traces( + marker=dict( + size=8, + symbol="diamond-open", + line=dict( + width=2, +# color="DarkSlateGrey" Line colors don't apply to open markers + ) + ), + selector=dict(mode="markers"), +) + +fig.show() +``` + ### Setting Marker Angles From d42b6b3ffb936530d45804aa60ee458e14e40ed3 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 5 Feb 2024 08:59:38 -0500 Subject: [PATCH 2/2] Update doc/python/marker-style.md --- doc/python/marker-style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/marker-style.md b/doc/python/marker-style.md index 91d136bcc58..f68030e096e 100644 --- a/doc/python/marker-style.md +++ b/doc/python/marker-style.md @@ -380,7 +380,7 @@ fig.show() #### Open Marker Colors -In the previous example, each marker has two colors, a marker color (set in Plotly Express with `color="species"`) and a line color (set on the line with `color="DarkSlateGrey"`. When using open markers, like `"diamond-open"` in the following example, the marker always uses only the marker color. Adding a line color won't update the marker. +In the previous example, each marker has two colors, a marker color (set in Plotly Express with `color="species"`) and a line color (set on the line with `color="DarkSlateGrey"`. All open markers, like "diamond-open" in the following example, have a transparent fill, which means you can specify only one color. Specify this color using the marker color parameter. This controls the outline color and any dot or cross. For open markers, the line color does nothing. ```python import plotly.express as px