You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/getting_started.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,7 @@ samples = [
134
134
# And finish by styling it up to your liking!
135
135
fig = ridgeplot(
136
136
samples=samples,
137
+
labels=[["Min Temperature [F]", "Max Temperature [F]"]] *len(months),
137
138
row_labels=months,
138
139
colorscale="Inferno",
139
140
bandwidth=4,
@@ -228,6 +229,7 @@ Finally, we can pass the {py:paramref}`~ridgeplot.ridgeplot.samples` list to the
228
229
```python
229
230
fig = ridgeplot(
230
231
samples=samples,
232
+
labels=[["Min Temperature [F]", "Max Temperature [F]"]] *len(months),
231
233
row_labels=months,
232
234
colorscale="Inferno",
233
235
bandwidth=4,
@@ -237,8 +239,8 @@ fig = ridgeplot(
237
239
238
240
fig.update_layout(
239
241
title="Minimum and maximum daily temperatures in Lincoln, NE (2016)",
240
-
height=650,
241
-
width=950,
242
+
height=600,
243
+
width=800,
242
244
font_size=14,
243
245
plot_bgcolor="rgb(245, 245, 245)",
244
246
xaxis_gridcolor="white",
@@ -261,15 +263,24 @@ fig.show()
261
263
We are currently investigating the best way to support all color options available in Plotly Express. If you have any suggestions or requests, or just want to track the progress, please check out {gh-issue}`226`.
262
264
:::
263
265
264
-
The {py:func}`~ridgeplot.ridgeplot()` function offers flexible customisation options that help you control the automatic coloring of ridgeline traces. Take a look at {py:paramref}`~ridgeplot.ridgeplot.colorscale`, {py:paramref}`~ridgeplot.ridgeplot.colormode`, and {py:paramref}`~ridgeplot.ridgeplot.opacity` for more information.
266
+
The {py:func}`~ridgeplot.ridgeplot()` function offers flexible customisation options that help you control the exact coloring of ridgeline traces. Take a look at {py:paramref}`~ridgeplot.ridgeplot.colorscale`, {py:paramref}`~ridgeplot.ridgeplot.colormode`, {py:paramref}`~ridgeplot.ridgeplot.color_discrete_map`, {py:paramref}`~ridgeplot.ridgeplot.opacity`, and {py:paramref}`~ridgeplot.ridgeplot.line_color` for a detailed description of the available options.
267
+
268
+
As a simple (but quite common) example, we'll try to adjust the output of the previous example to use different discrete colors for the minimum and maximum temperature traces. Specifically, we'll set all minimum temperature traces to a shade of blue and all maximum temperature traces to a shade of red. To achieve this, we just need to set the {py:paramref}`~ridgeplot.ridgeplot.color_discrete_map` parameter to a dictionary that maps the trace labels to the desired colors.
265
269
266
-
To demonstrate how these options can be used, we can try to adjust the output from the previous example to use different colors for the minimum and maximum temperature traces. For instance, setting all minimum temperature traces to a shade of blue and all maximum temperature traces to a shade of red. To achieve this, we just need to adjust the {py:paramref}`~ridgeplot.ridgeplot.colorscale` and {py:paramref}`~ridgeplot.ridgeplot.colormode` parameters in the call to the {py:func}`~ridgeplot.ridgeplot()` function. _i.e._,
270
+
:::{note}
271
+
Because the {py:paramref}`~ridgeplot.ridgeplot.color_discrete_map` parameter takes precedence over the {py:paramref}`~ridgeplot.ridgeplot.colorscale` and {py:paramref}`~ridgeplot.ridgeplot.colormode` parameters, we can keep them as they are in the previous example. However, since their behavior will be overridden by {py:paramref}`~ridgeplot.ridgeplot.color_discrete_map`, it is a good practice to remove them from the function call to avoid any confusion.
272
+
:::
267
273
268
274
```python
269
275
fig = ridgeplot(
270
-
# Same options as before, with only the following changes:
0 commit comments