Skip to content

Commit 4e3256b

Browse files
smith doc tweaks
1 parent 724751e commit 4e3256b

File tree

1 file changed

+36
-37
lines changed

1 file changed

+36
-37
lines changed

doc/python/smith-charts.md

+36-37
Original file line numberDiff line numberDiff line change
@@ -40,52 +40,51 @@ A [Smith Chart](https://en.wikipedia.org/wiki/Smith_chart) is a specialized char
4040

4141
```python
4242
import plotly.graph_objects as go
43-
fig = go.Figure(
44-
go.Scattersmith(
45-
imag=[0.5, 1, 2, 3],
46-
real=[0.5, 1, 2, 3],
47-
)
48-
)
43+
44+
fig = go.Figure(go.Scattersmith(imag=[0.5, 1, 2, 3], real=[0.5, 1, 2, 3]))
4945
fig.show()
5046
```
5147

5248
### Smith Chart Subplots and Styling
5349

5450
```python
5551
import plotly.graph_objects as go
56-
fig = go.Figure(
57-
data=[
58-
go.Scattersmith(
59-
imag=[1],
60-
real=[1],
61-
marker_symbol='x',
62-
marker_size=30,
63-
marker_color="green",
64-
subplot="smith1"
65-
),
66-
go.Scattersmith(
67-
imag=[1],
68-
real=[1],
69-
marker_symbol='x',
70-
marker_size=30,
71-
marker_color="pink",
72-
subplot="smith2"
73-
)
74-
],
75-
layout=dict(
76-
smith=go.layout.Smith(
77-
bgcolor='lightgrey',
78-
realaxis_gridcolor='red',
79-
imaginaryaxis_gridcolor='blue',
80-
domain=dict(x=[0,0.5])
81-
),
82-
smith2=go.layout.Smith(
83-
realaxis_gridcolor='blue',
84-
imaginaryaxis_gridcolor='red',
85-
domain=dict(x=[0.5,1])
86-
)
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])
8783
)
8884
)
85+
86+
fig.update_smiths(bgcolor="lightgrey")
87+
8988
fig.show()
9089
```
9190

0 commit comments

Comments
 (0)