diff --git a/packages/python/plotly/plotly/express/_chart_types.py b/packages/python/plotly/plotly/express/_chart_types.py index 2466595c31c..f7e7da8cbfd 100644 --- a/packages/python/plotly/plotly/express/_chart_types.py +++ b/packages/python/plotly/plotly/express/_chart_types.py @@ -1234,6 +1234,7 @@ def pie( template=None, width=None, height=None, + opacity=None, hole=None, ): """ @@ -1398,9 +1399,7 @@ def funnel( rectangular sector of a funnel. """ return make_figure( - args=locals(), - constructor=go.Funnel, - trace_patch=dict(opacity=opacity, orientation=orientation), + args=locals(), constructor=go.Funnel, trace_patch=dict(orientation=orientation), ) @@ -1422,6 +1421,7 @@ def funnel_area( template=None, width=None, height=None, + opacity=None, ): """ In a funnel area plot, each row of `data_frame` is represented as a diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index de2af43131d..7a28637fee6 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -1278,6 +1278,8 @@ def infer_config(args, constructor, trace_patch): if args["opacity"] is None: if "barmode" in args and args["barmode"] == "overlay": trace_patch["marker"] = dict(opacity=0.5) + elif constructor in [go.Densitymapbox, go.Pie, go.Funnel, go.Funnelarea]: + trace_patch["opacity"] = args["opacity"] else: trace_patch["marker"] = dict(opacity=args["opacity"]) if "line_group" in args: