@@ -1172,3 +1172,37 @@ def test_colorbar_pos():
1172
1172
fig .canvas .draw ()
1173
1173
# check that actually on the bottom
1174
1174
assert cbar .ax .get_position ().extents [1 ] < 0.2
1175
+
1176
+
1177
+ @image_comparison (['stem3d.png' ], style = 'mpl20' )
1178
+ def test_stem3d ():
1179
+ theta = np .linspace (0 , 2 * np .pi )
1180
+ x = np .cos (theta - np .pi / 2 )
1181
+ y = np .sin (theta - np .pi / 2 )
1182
+ z = theta
1183
+
1184
+ fig , axs = plt .subplots (1 , 3 , figsize = (8 , 3 ),
1185
+ constrained_layout = True ,
1186
+ subplot_kw = {'projection' : '3d' })
1187
+ for ax , zdir in zip (axs , ['x' , 'y' , 'z' ]):
1188
+ ax .stem (x , y , z , orientation = zdir )
1189
+ ax .set_title (f'orientation={ zdir } ' )
1190
+
1191
+
1192
+ @image_comparison (baseline_images = ['stem3d_options.png' ], style = 'mpl20' )
1193
+ def test_stem3d_options ():
1194
+ x = np .linspace (- np .pi / 2 , np .pi / 2 , 20 )
1195
+ y = np .ones_like (x )
1196
+ z = np .cos (x )
1197
+
1198
+ fig , axs = plt .subplots (1 , 3 , figsize = (8 , 3 ),
1199
+ constrained_layout = True ,
1200
+ subplot_kw = {'projection' : '3d' })
1201
+ for ax , zdir in zip (axs , ['x' , 'y' , 'z' ]):
1202
+ markerline , stemlines , baseline = ax .stem (
1203
+ x , y , z ,
1204
+ linefmt = 'C4-.' , markerfmt = 'C1D' , basefmt = 'C2' ,
1205
+ orientation = zdir )
1206
+ ax .set_title (f'orientation={ zdir } ' )
1207
+ markerline .set (markerfacecolor = 'none' , markeredgewidth = 2 )
1208
+ baseline .set_linewidth (3 )
0 commit comments