Skip to content

Commit 2dedf02

Browse files
docs and changelog
1 parent 7d8ced4 commit 2dedf02

File tree

3 files changed

+48
-14
lines changed

3 files changed

+48
-14
lines changed

Diff for: CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55

6+
## [5.7.0] - UNRELEASED
7+
8+
### Added
9+
- added `pattern_shape` options to `px.area()` [#3668](https://github.com/plotly/plotly.py/issues/3668)
10+
11+
### Updated
12+
- Updated Plotly.js to from version 2.9.0 to version 2.11.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2111----2022-03-15) for more information. Notable changes include:
13+
- Add `fillpattern` options to `scatter` trace
14+
- Various JS-specific improvements such as MathJax 3.0 support
15+
616
## [5.6.0] - 2022-02-09
717

818
### Updated

Diff for: doc/python/filled-area-plots.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.6.0
8+
format_version: '1.3'
9+
jupytext_version: 1.13.7
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.6
23+
version: 3.9.7
2424
plotly:
2525
description: How to make filled area plots in Python with Plotly.
2626
display_as: basic
@@ -44,8 +44,7 @@ This example shows how to fill the area enclosed by traces.
4444
```python
4545
import plotly.express as px
4646
df = px.data.gapminder()
47-
fig = px.area(df, x="year", y="pop", color="continent",
48-
line_group="country")
47+
fig = px.area(df, x="year", y="pop", color="continent", line_group="country")
4948
fig.show()
5049
```
5150

@@ -62,11 +61,28 @@ snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-
6261
IFrame(snippet_url + 'filled-area-plots', width='100%', height=1200)
6362
```
6463

64+
### Pattern Fills
65+
66+
*New in v5.0*
67+
68+
Area charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:
69+
70+
```python
71+
import plotly.express as px
72+
df = px.data.medals_long()
73+
74+
fig = px.area(df, x="medal", y="count", color="nation",
75+
pattern_shape="nation", pattern_shape_sequence=[".", "x", "+"])
76+
fig.show()
77+
```
78+
79+
<!-- #region tags=[] -->
6580
### Filled area chart with plotly.graph_objects
6681

6782
#### Basic Overlaid Area Chart
83+
<!-- #endregion -->
6884

69-
```python
85+
```python tags=[]
7086
import plotly.graph_objects as go
7187

7288
fig = go.Figure()

Diff for: doc/python/pattern-hatching-texture.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.13.7
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.9.7
2424
plotly:
2525
description: How to use patterns (also known as hatching or texture) with bar
2626
charts.
@@ -36,16 +36,16 @@ jupyter:
3636

3737
*New in v5.0*
3838

39-
[Bar charts](/python/bar-charts/), [histograms](/python/histograms/) and [polar bar charts](/python/wind-rose-charts/) have large markers which support not only a fill color, but also an optional **pattern** (also known as "hatching" or "texture"). This can be used for a variety of reasons:
39+
[Bar charts](/python/bar-charts/), [histograms](/python/histograms/), [polar bar charts](/python/wind-rose-charts/) and [area charts](/python/filled-area-plots/) have large markers or areas which support not only a fill color, but also an optional **pattern** (also known as "hatching" or "texture"). This can be used for a variety of reasons:
4040

4141
* to double-encode variables (i.e. using both color and pattern) to improve accessibility for visually-impaired end-users
4242
* to encode an additional variable beyond just using color
4343
* to make charts that are easier to print in black and white
4444

4545

46-
### Patterned Bar Charts with Plotly Express
46+
### Patterned Charts with Plotly Express
4747

48-
the `px.bar()`, `px.histogram()` and `px.bar_polar()` functions support the `pattern_shape` argument. In the chart below, we double-encode `nation` using color and pattern:
48+
the `px.bar()`, `px.histogram()`, `px.bar_polar()` and `px.area()` functions support the `pattern_shape` argument. In the chart below, we double-encode `nation` using color and pattern:
4949

5050
```python
5151
import plotly.express as px
@@ -55,6 +55,14 @@ fig = px.bar(df, x="medal", y="count", color="nation", pattern_shape="nation")
5555
fig.show()
5656
```
5757

58+
```python
59+
import plotly.express as px
60+
df = px.data.medals_long()
61+
62+
fig = px.area(df, x="medal", y="count", color="nation", pattern_shape="nation")
63+
fig.show()
64+
```
65+
5866
In the chart below we use `px.histogram()` instead of `px.bar()` to aggregate multiple values together, and encode one variable (sex) using both color and x-position and another (smoker) using patterns:
5967

6068
```python

0 commit comments

Comments
 (0)