Skip to content

Commit a62225a

Browse files
docs and changelog for fig.set_subplots
1 parent c006c1f commit a62225a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [4.13.0] - UNRELEASED
66

7+
### Added
8+
9+
- `go.Figure` now has a `set_subplots` method to set subplots on an already
10+
existing figure.
711

812

913
## [4.12.1] - UNRELEASED

doc/python/subplots.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,26 @@ fig = go.Figure(data=data, layout=layout)
581581
fig.show()
582582
```
583583

584+
#### Setting Subplots on a Figure Directly
585+
586+
_new in 4.13_
587+
588+
Subplots can be added to an already existing figure, provided it doesn't already
589+
have subplots. `go.Figure.set_subplots` accepts all the same arguments as
590+
`plotly.subplots.make_subplots`.
591+
592+
```python
593+
import plotly.graph_objects as go
594+
fig = go.Figure().set_subplots(2, 3, horizontal_spacing=0.1)
595+
```
596+
597+
is equivalent to:
598+
599+
```python
600+
from plotly.subplots import make_subplots
601+
fig = make_subplots(2, 3, horizontal_spacing=0.1)
602+
```
603+
584604
#### Reference
585605
All of the x-axis properties are found here: https://plotly.com/python/reference/XAxis/
586606
All of the y-axis properties are found here: https://plotly.com/python/reference/YAxis/

0 commit comments

Comments
 (0)