Skip to content

Commit 0675fc1

Browse files
Merge branch 'doc-prod'
2 parents 9aaee25 + 4e3256b commit 0675fc1

File tree

2 files changed

+106
-6
lines changed

2 files changed

+106
-6
lines changed

Diff for: doc/python/figure-structure.md

+10-6
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.2'
9-
jupytext_version: 1.6.0
8+
format_version: '1.3'
9+
jupytext_version: 1.11.4
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.6
23+
version: 3.8.11
2424
plotly:
2525
description: The structure of a figure - data, traces and layout explained.
2626
display_as: file_settings
@@ -93,7 +93,7 @@ The second of the three top-level attributes of a figure is `layout`, whose valu
9393
* Subplots of various types on which can be drawn multiple traces and which are positioned in paper coordinates:
9494
* `xaxis`, `yaxis`, `xaxis2`, `yaxis3` etc: X and Y cartesian axes, the intersections of which are cartesian subplots
9595
* `scene`, `scene2`, `scene3` etc: 3d scene subplots
96-
* `ternary`, `ternary2`, `ternary3`, `polar`, `polar2`, `polar3`, `geo`, `geo2`, `geo3`, `mapbox`, `mapbox2`, `mabox3` etc: ternary, polar, geo or mapbox subplots
96+
* `ternary`, `ternary2`, `ternary3`, `polar`, `polar2`, `polar3`, `geo`, `geo2`, `geo3`, `mapbox`, `mapbox2`, `mabox3`, `smith`, `smith2` etc: ternary, polar, geo, mapbox or smith subplots
9797
* Non-data marks which can be positioned in paper coordinates, or in data coordinates linked to 2d cartesian subplots:
9898
* `annotations`: [textual annotations with or without arrows](/python/text-and-annotations/)
9999
* `shapes`: [lines, rectangles, ellipses or open or closed paths](/python/shapes/)
@@ -151,9 +151,9 @@ The following trace types are compatible with 2d-cartesian subplots via the `xax
151151
* [`carpet`](/python/carpet-plot/): a special trace type for building [carpet plots](/python/carpet-plot/), in that other traces can use as subplots (see below)
152152
* [`splom`](/python/splom/): multi-dimensional scatter plots which implicitly refer to many 2-d cartesian subplots at once.
153153

154-
### 3D, Polar and Ternary Trace Types and Subplots
154+
### 3D, Polar, Ternary and Smith Trace Types and Subplots
155155

156-
Beyond 2D cartesian subplots, figures can include [three-dimensional cartesian subplots](/python/3d-charts/), [polar subplots](/python/polar-chart/) and [ternary subplots](/python/ternary-plots/). The following trace types support attributes named `scene`, `polar` or `ternary`, whose values must refer to corresponding objects in the layout portion of the figure i.e. `ternary="ternary2"` etc. Note that attributes such as `layout.scene` and `layout.ternary2` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
156+
Beyond 2D cartesian subplots, figures can include [three-dimensional cartesian subplots](/python/3d-charts/), [polar subplots](/python/polar-chart/), [ternary subplots](/python/ternary-plots/) and [smith subplots](/python/smith-charts/). The following trace types support attributes named `scene`, `polar`, `smith` or `ternary`, whose values must refer to corresponding objects in the layout portion of the figure i.e. `ternary="ternary2"` etc. Note that attributes such as `layout.scene` and `layout.ternary2` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
157157

158158
The following trace types are compatible with 3D subplots via the `scene` attribute, which contains special [camera controls](/python/3d-camera-controls/):
159159

@@ -171,6 +171,10 @@ The following trace types are compatible with ternary subplots via the `ternary`
171171

172172
* [`scatterternary`](/python/ternary-plots/), which can be used to draw individual markers, [curves and filled areas](/python/ternary-contour/)
173173

174+
The following trace types are compatible with smith subplots via the `smith` attribute:
175+
176+
* [`scattersmith`](/python/smith-charts/), which can be used to draw individual markers, curves and filled areas
177+
174178
### Map Trace Types and Subplots
175179

176180
Figures can include two different types of map subplots: [geo subplots for outline maps](/python/map-configuration/) and [mapbox subplots for tile maps](/python/mapbox-layers/). The following trace types support attributes named `geo` or `mapbox`, whose values must refer to corresponding objects in the layout i.e. `geo="geo2"` etc. Note that attributes such as `layout.geo2` and `layout.mapbox` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.

Diff for: doc/python/smith-charts.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
jupyter:
3+
jupytext:
4+
notebook_metadata_filter: all
5+
text_representation:
6+
extension: .md
7+
format_name: markdown
8+
format_version: '1.3'
9+
jupytext_version: 1.11.4
10+
kernelspec:
11+
display_name: Python 3
12+
language: python
13+
name: python3
14+
language_info:
15+
codemirror_mode:
16+
name: ipython
17+
version: 3
18+
file_extension: .py
19+
mimetype: text/x-python
20+
name: python
21+
nbconvert_exporter: python
22+
pygments_lexer: ipython3
23+
version: 3.8.11
24+
plotly:
25+
description: How to make Smith Charts with plotly.
26+
display_as: scientific
27+
language: python
28+
layout: base
29+
name: Smith Charts
30+
order: 21
31+
page_type: u-guide
32+
permalink: python/smith-charts/
33+
thumbnail: thumbnail/contourcarpet.jpg
34+
---
35+
36+
A [Smith Chart](https://en.wikipedia.org/wiki/Smith_chart) is a specialized chart for visualizing [complex numbers](https://en.wikipedia.org/wiki/Complex_number): numbers with both a real and imaginary part.
37+
38+
39+
### Smith Charts with Plotly Graph Objects
40+
41+
```python
42+
import plotly.graph_objects as go
43+
44+
fig = go.Figure(go.Scattersmith(imag=[0.5, 1, 2, 3], real=[0.5, 1, 2, 3]))
45+
fig.show()
46+
```
47+
48+
### Smith Chart Subplots and Styling
49+
50+
```python
51+
import plotly.graph_objects as go
52+
53+
fig = go.Figure()
54+
55+
fig.add_trace(go.Scattersmith(
56+
imag=[1],
57+
real=[1],
58+
marker_symbol='x',
59+
marker_size=30,
60+
marker_color="green",
61+
subplot="smith1"
62+
))
63+
64+
fig.add_trace(go.Scattersmith(
65+
imag=[1],
66+
real=[1],
67+
marker_symbol='x',
68+
marker_size=30,
69+
marker_color="pink",
70+
subplot="smith2"
71+
))
72+
73+
fig.update_layout(
74+
smith=dict(
75+
realaxis_gridcolor='red',
76+
imaginaryaxis_gridcolor='blue',
77+
domain=dict(x=[0,0.45])
78+
),
79+
smith2=dict(
80+
realaxis_gridcolor='blue',
81+
imaginaryaxis_gridcolor='red',
82+
domain=dict(x=[0.55,1])
83+
)
84+
)
85+
86+
fig.update_smiths(bgcolor="lightgrey")
87+
88+
fig.show()
89+
```
90+
91+
#### Reference
92+
See https://plotly.com/python/reference/scattersmith/ and https://plotly.com/python/reference/layout/smith/ for more information and chart attribute options!
93+
94+
```python
95+
96+
```

0 commit comments

Comments
 (0)