Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e47978b

Browse files
Simplify labelling code
1 parent c969a14 commit e47978b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

uplot/plot2.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,14 @@ def find_in_lists(
7070
left_list: Optional[List[str]],
7171
right_list: Optional[List[str]],
7272
) -> Optional[str]:
73-
if left_list is not None:
74-
if i < len(left_list):
75-
return left_list[i]
76-
i -= len(left_labels)
77-
if right_list is not None and i >= 0:
78-
return right_list[i]
7973
return None
8074

81-
label = find_in_lists(i, left_labels, right_labels)
82-
if label is not None:
83-
new_series["label"] = label
75+
if left_labels is not None and i < nb_left:
76+
new_series["label"] = left_labels[i]
77+
if i >= nb_left:
78+
if right_labels is not None:
79+
new_series["label"] = right_labels[i - nb_left]
80+
new_series["scale"] = "right_axis"
8481

8582
# scale = find_in_lists(i, left_scales, right_scales)
8683
# if scale is not None:

0 commit comments

Comments
 (0)