Skip to content

ability to show markers on lines #3326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/python/plotly/plotly/express/_chart_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def line(
line_group=None,
color=None,
line_dash=None,
symbol=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand All @@ -234,6 +235,9 @@ def line(
color_discrete_map=None,
line_dash_sequence=None,
line_dash_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
log_x=False,
log_y=False,
range_x=None,
Expand Down Expand Up @@ -261,6 +265,7 @@ def area(
y=None,
line_group=None,
color=None,
symbol=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand All @@ -276,6 +281,9 @@ def area(
labels=None,
color_discrete_sequence=None,
color_discrete_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
orientation=None,
groupnorm=None,
log_x=False,
Expand Down Expand Up @@ -692,6 +700,7 @@ def line_3d(
line_dash=None,
text=None,
line_group=None,
symbol=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand All @@ -709,6 +718,9 @@ def line_3d(
color_discrete_map=None,
line_dash_sequence=None,
line_dash_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
log_x=False,
log_y=False,
log_z=False,
Expand Down Expand Up @@ -778,6 +790,7 @@ def line_ternary(
color=None,
line_dash=None,
line_group=None,
symbol=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand All @@ -790,6 +803,9 @@ def line_ternary(
color_discrete_map=None,
line_dash_sequence=None,
line_dash_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
line_shape=None,
title=None,
template=None,
Expand Down Expand Up @@ -862,6 +878,7 @@ def line_polar(
custom_data=None,
line_group=None,
text=None,
symbol=None,
animation_frame=None,
animation_group=None,
category_orders=None,
Expand All @@ -870,6 +887,9 @@ def line_polar(
color_discrete_map=None,
line_dash_sequence=None,
line_dash_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
direction="clockwise",
start_angle=90,
line_close=False,
Expand Down Expand Up @@ -1067,6 +1087,7 @@ def line_geo(
hover_data=None,
custom_data=None,
line_group=None,
symbol=None,
animation_frame=None,
animation_group=None,
category_orders=None,
Expand All @@ -1075,6 +1096,9 @@ def line_geo(
color_discrete_map=None,
line_dash_sequence=None,
line_dash_map=None,
symbol_sequence=None,
symbol_map=None,
markers=False,
projection=None,
scope=None,
center=None,
Expand Down
9 changes: 7 additions & 2 deletions packages/python/plotly/plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,8 +1782,13 @@ def infer_config(args, constructor, trace_patch, layout_patch):
trace_patch["opacity"] = args["opacity"]
else:
trace_patch["marker"] = dict(opacity=args["opacity"])
if "line_group" in args:
trace_patch["mode"] = "lines" + ("+markers+text" if args["text"] else "")
if "line_group" in args: # px.line, px.line_*, px.area
modes = set(["lines"])
if args.get("text") or args.get("symbol") or args.get("markers"):
modes.add("markers")
if args.get("text"):
modes.add("text")
trace_patch["mode"] = "+".join(modes)
elif constructor != go.Splom and (
"symbol" in args or constructor == go.Scattermapbox
):
Expand Down
1 change: 1 addition & 0 deletions packages/python/plotly/plotly/express/_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
"Setting this value is recommended when using `plotly.express.colors.diverging` color scales as the inputs to `color_continuous_scale`.",
],
size_max=["int (default `20`)", "Set the maximum mark size when using `size`."],
markers=["boolean (default `False`)", "If `True`, markers are shown on lines.",],
log_x=[
"boolean (default `False`)",
"If `True`, the x-axis is log-scaled in cartesian coordinates.",
Expand Down