Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion packages/python/plotly/plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ def infer_config(args, constructor, trace_patch, layout_patch):
modes.add("text")
if len(modes) == 0:
modes.add("lines")
trace_patch["mode"] = "+".join(modes)
trace_patch["mode"] = "+".join(sorted(modes))
elif constructor != go.Splom and (
"symbol" in args or constructor == go.Scattermapbox
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ def test_labels():
assert fig.layout.annotations[4].text.startswith("TIME")


@pytest.mark.parametrize(
["extra_kwargs", "expected_mode"],
[
({}, "lines"),
({"markers": True}, "lines+markers"),
({"text": "continent"}, "lines+markers+text"),
],
)
def test_line_mode(extra_kwargs, expected_mode):
gapminder = px.data.gapminder()
fig = px.line(
gapminder,
x="year",
y="pop",
color="country",
**extra_kwargs,
)
assert fig.data[0].mode == expected_mode


def test_px_templates():
try:
import plotly.graph_objects as go
Expand Down