@@ -36,8 +36,110 @@ tipping_plots = dx.make_subplots(
3636
3737![ Sub Plot Basic Example] ( ./_assets/sub_plot.png )
3838
39- ## API Reference
39+ ### Share Axes
40+
41+ Share axes between plots with the ` shared_xaxes ` and ` shared_yaxes ` parameters.
42+
43+ #### Share All Axes
44+
45+ When ` shared_xaxes ` or ` shared_yaxes ` is set to ` "all" ` , all axes of the same type are shared.
46+ When one axis is adjusted, all axes are adjusted to match.
47+
48+ ``` python order=tipping_plots,lunch_tips,dinner_tips
49+ import deephaven.plot.express as dx
50+ tips = dx.data.tips() # import a ticking version of the Tips dataset
51+
52+ # filter the tips dataset for separate lunch and dinner charts
53+ lunch_tips = tips.where(" Time = `Lunch`" )
54+ dinner_tips = tips.where(" Time = `Dinner`" )
55+
56+ # create chart that shares all axes
57+ tipping_plots = dx.make_subplots(
58+ dx.scatter(lunch_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Lunch Tips" }),
59+ dx.scatter(dinner_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Dinner Tips" }),
60+ rows = 2 , shared_yaxes = " all" , shared_xaxes = " all"
61+ )
62+ ```
63+
64+ #### Share Y Axes
65+
66+ When ` shared_yaxis ` is set to ` True ` , all y axes are shared along the same row.
67+ When one y-axis is adjusted, all axes along the same row are adjusted to match.
68+
69+ ``` python order=tipping_plots,lunch_tips,dinner_tips
70+ import deephaven.plot.express as dx
71+ tips = dx.data.tips() # import a ticking version of the Tips dataset
72+
73+ # filter the tips dataset for separate lunch and dinner charts
74+ lunch_tips = tips.where(" Time = `Lunch`" )
75+ dinner_tips = tips.where(" Time = `Dinner`" )
76+
77+ # create chart that shares y axes along the row
78+ tipping_plots = dx.make_subplots(
79+ dx.scatter(lunch_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Lunch Tips" }),
80+ dx.scatter(dinner_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Dinner Tips" }),
81+ cols = 2 , shared_yaxes = True
82+ )
83+ ```
84+
85+ To share the y axes along the same column, set ` shared_yaxes ` to ` "columns" ` .
86+
87+ ``` python order=tipping_plots,lunch_tips,dinner_tips
88+ import deephaven.plot.express as dx
89+ tips = dx.data.tips() # import a ticking version of the Tips dataset
4090
91+ # filter the tips dataset for separate lunch and dinner charts
92+ lunch_tips = tips.where(" Time = `Lunch`" )
93+ dinner_tips = tips.where(" Time = `Dinner`" )
94+
95+ # create chart that shares y axes along the column
96+ tipping_plots = dx.make_subplots(
97+ dx.scatter(lunch_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Lunch Tips" }),
98+ dx.scatter(dinner_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Dinner Tips" }),
99+ rows = 2 , shared_yaxes = " columns"
100+ )
101+ ```
102+
103+ #### Share X Axes
104+
105+ When ` shared_xaxis ` is set to ` True ` , all x axes are shared along the same column.
106+ When one x-axis is adjusted, all axes along the same column are adjusted to match.
107+
108+ ``` python order=tipping_plots,lunch_tips,dinner_tips
109+ import deephaven.plot.express as dx
110+ tips = dx.data.tips() # import a ticking version of the Tips dataset
111+
112+ # filter the tips dataset for separate lunch and dinner charts
113+ lunch_tips = tips.where(" Time = `Lunch`" )
114+ dinner_tips = tips.where(" Time = `Dinner`" )
115+
116+ # create chart that shares x axes along the column
117+ tipping_plots = dx.make_subplots(
118+ dx.scatter(lunch_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Lunch Tips" }),
119+ dx.scatter(dinner_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Dinner Tips" }),
120+ rows = 2 , shared_xaxes = True
121+ )
122+ ```
123+
124+ To share the x axes along the same column, set ` shared_yaxes ` to ` "columns" ` .
125+
126+ ``` python order=tipping_plots,lunch_tips,dinner_tips
127+ import deephaven.plot.express as dx
128+ tips = dx.data.tips() # import a ticking version of the Tips dataset
129+
130+ # filter the tips dataset for separate lunch and dinner charts
131+ lunch_tips = tips.where(" Time = `Lunch`" )
132+ dinner_tips = tips.where(" Time = `Dinner`" )
133+
134+ # create chart that shares x axes along the row
135+ tipping_plots = dx.make_subplots(
136+ dx.scatter(lunch_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Lunch Tips" }),
137+ dx.scatter(dinner_tips, x = " TotalBill" , y = " Tip" , labels = {" Tip" : " Dinner Tips" }),
138+ cols = 2 , shared_xaxes = " rows"
139+ )
140+ ```
141+
142+ ## API Reference
41143``` {eval-rst}
42144.. dhautofunction:: deephaven.plot.express.make_subplots
43145```
0 commit comments