Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61fb14b

Browse filesBrowse files
authored
example with reversed colorscale (plotly#1997)
* example with reversed colorscale * updated changelog
1 parent d34ab39 commit 61fb14b
Copy full SHA for 61fb14b

File tree

Expand file treeCollapse file tree

2 files changed

+25
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+25
-2
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3434
have a `range_theta` keyword argument for representing only an angular
3535
section [#1969](https://github.com/plotly/plotly.py/pull/1969).
3636
- Docstrings of plotly.py are now doctested [#1921](https://github.com/plotly/plotly.py/pull/1921).
37+
- Reversing a predefined colorscale by appending `_r` to its name [#1933](https://github.com/plotly/plotly.py/pull/1933)
3738

3839
## [4.3.0] - 2019-11-11
3940

‎doc/python/colorscales.md

Copy file name to clipboardExpand all lines: doc/python/colorscales.md
+24-2Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.2.1
8+
format_version: '1.2'
9+
jupytext_version: 1.3.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -62,6 +62,28 @@ fig = px.scatter(iris, x="sepal_width", y="sepal_length",
6262
fig.show()
6363
```
6464

65+
### Reversing a predefined colorscale
66+
67+
You can reverse a predefined colorscale by appending `_r` to its name, for colorscales given either as a string or a `plotly` object.
68+
69+
```python
70+
import plotly.express as px
71+
iris = px.data.iris()
72+
fig = px.scatter(iris, x="sepal_width", y="sepal_length",
73+
color="sepal_length", color_continuous_scale='Magma_r')
74+
75+
fig.show()
76+
```
77+
78+
```python
79+
import plotly.express as px
80+
data = [[1, .3, .5, .9],
81+
[.3, .1, .4, 1],
82+
[.2, .8, .9, .3]]
83+
fig = px.imshow(data, color_continuous_scale=px.colors.diverging.Tealrose_r)
84+
fig.show()
85+
```
86+
6587
### Custom Discretized Heatmap Colorscale
6688

6789
```python

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.