@@ -40,52 +40,51 @@ A [Smith Chart](https://en.wikipedia.org/wiki/Smith_chart) is a specialized char
40
40
41
41
``` python
42
42
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 ]))
49
45
fig.show()
50
46
```
51
47
52
48
### Smith Chart Subplots and Styling
53
49
54
50
``` python
55
51
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 ] )
87
83
)
88
84
)
85
+
86
+ fig.update_smiths(bgcolor = " lightgrey" )
87
+
89
88
fig.show()
90
89
```
91
90
0 commit comments