@@ -1194,7 +1194,7 @@ def aggfunc_continuous(x):
11941194 return args
11951195
11961196
1197- def infer_config (args , constructor , trace_patch ):
1197+ def infer_config (args , constructor , trace_patch , layout_patch ):
11981198 # Declare all supported attributes, across all plot types
11991199 attrables = (
12001200 ["x" , "y" , "z" , "a" , "b" , "c" , "r" , "theta" , "size" , "dimensions" ]
@@ -1246,6 +1246,16 @@ def infer_config(args, constructor, trace_patch):
12461246 trace_patch ["bingroup" ] = "x" if orientation == "v" else "y"
12471247 trace_patch ["orientation" ] = args ["orientation" ]
12481248
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+
12491259 attrs = [k for k in attrables if k in args ]
12501260 grouped_attrs = []
12511261
@@ -1396,7 +1406,7 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
13961406 apply_default_cascade (args )
13971407
13981408 args , trace_specs , grouped_mappings , sizeref , show_colorbar = infer_config (
1399- args , constructor , trace_patch
1409+ args , constructor , trace_patch , layout_patch
14001410 )
14011411 grouper = [x .grouper or one_group for x in grouped_mappings ] or [one_group ]
14021412 grouped = args ["data_frame" ].groupby (grouper , sort = False )
0 commit comments