@@ -1194,7 +1194,7 @@ def aggfunc_continuous(x):
1194
1194
return args
1195
1195
1196
1196
1197
- def infer_config (args , constructor , trace_patch ):
1197
+ def infer_config (args , constructor , trace_patch , layout_patch ):
1198
1198
# Declare all supported attributes, across all plot types
1199
1199
attrables = (
1200
1200
["x" , "y" , "z" , "a" , "b" , "c" , "r" , "theta" , "size" , "dimensions" ]
@@ -1246,6 +1246,16 @@ def infer_config(args, constructor, trace_patch):
1246
1246
trace_patch ["bingroup" ] = "x" if orientation == "v" else "y"
1247
1247
trace_patch ["orientation" ] = args ["orientation" ]
1248
1248
1249
+ if constructor in [go .Violin , go .Box ]:
1250
+ mode = "boxmode" if constructor == go .Box else "violinmode"
1251
+ if layout_patch [mode ] is None and args ["color" ] is not None :
1252
+ if args ["y" ] == args ["color" ] and args ["orientation" ] == "h" :
1253
+ layout_patch [mode ] = "overlay"
1254
+ elif args ["x" ] == args ["color" ] and args ["orientation" ] == "v" :
1255
+ layout_patch [mode ] = "overlay"
1256
+ if layout_patch [mode ] is None :
1257
+ layout_patch [mode ] = "group"
1258
+
1249
1259
attrs = [k for k in attrables if k in args ]
1250
1260
grouped_attrs = []
1251
1261
@@ -1396,7 +1406,7 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
1396
1406
apply_default_cascade (args )
1397
1407
1398
1408
args , trace_specs , grouped_mappings , sizeref , show_colorbar = infer_config (
1399
- args , constructor , trace_patch
1409
+ args , constructor , trace_patch , layout_patch
1400
1410
)
1401
1411
grouper = [x .grouper or one_group for x in grouped_mappings ] or [one_group ]
1402
1412
grouped = args ["data_frame" ].groupby (grouper , sort = False )
0 commit comments