Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d673d0a

Browse filesBrowse files
committed
BUG: Single legend item for indicators with singular/default names
Refs: 01551af Populating legends with numerous `λ[i]` items was never the intention of #382
1 parent 3938cf7 commit d673d0a
Copy full SHA for d673d0a

File tree

1 file changed

+1
-7
lines changed
Filter options

1 file changed

+1
-7
lines changed

‎backtesting/_plotting.py

Copy file name to clipboardExpand all lines: backtesting/_plotting.py
+1-7
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,7 @@ def __eq__(self, other):
567567

568568
if isinstance(value.name, str):
569569
tooltip_label = value.name
570-
if len(value) == 1:
571-
legend_labels = [LegendStr(value.name)]
572-
else:
573-
legend_labels = [
574-
LegendStr(f"{value.name}[{i}]")
575-
for i in range(len(value))
576-
]
570+
legend_labels = [LegendStr(value.name)] * len(value)
577571
else:
578572
tooltip_label = ", ".join(value.name)
579573
legend_labels = [LegendStr(item) for item in value.name]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.