Skip to content

Commit

Permalink
[tag] fixed index overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
janscience committed Nov 16, 2024
1 parent ad71d2a commit 50aed67
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/plottools/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ def tag(fig=None, axes=None, xoffs=None, yoffs=None,
mlabel = mlabel.replace('%a', chr(ord('a') + major_index + k))
mlabel = mlabel.replace('%A', chr(ord('A') + major_index + k))
mlabel = mlabel.replace('%1', chr(ord('1') + major_index + k))
mlabel = mlabel.replace('%i', romans_lower[major_index + k])
mlabel = mlabel.replace('%I', romans_upper[major_index + k])
if major_index + k < len(romans_lower):
mlabel = mlabel.replace('%i', romans_lower[major_index + k])
mlabel = mlabel.replace('%I', romans_upper[major_index + k])
mlabel = mlabel.replace('%ma', chr(ord('a') + minor_index + j))
mlabel = mlabel.replace('%mA', chr(ord('A') + minor_index + j))
mlabel = mlabel.replace('%m1', chr(ord('1') + minor_index + j))
mlabel = mlabel.replace('%mi', romans_lower[minor_index + j])
mlabel = mlabel.replace('%mI', romans_upper[minor_index + j])
if minor_index + j < len(romans_lower):
mlabel = mlabel.replace('%mi', romans_lower[minor_index + j])
mlabel = mlabel.replace('%mI', romans_upper[minor_index + j])
label_list.append(mlabel)
j += 1
if j > 0:
Expand All @@ -147,8 +149,9 @@ def tag(fig=None, axes=None, xoffs=None, yoffs=None,
label = labels.replace('%a', chr(ord('a') + major_index + k))
label = label.replace('%A', chr(ord('A') + major_index + k))
label = label.replace('%1', chr(ord('1') + major_index + k))
label = label.replace('%i', romans_lower[major_index + k])
label = label.replace('%I', romans_upper[major_index + k])
if major_index + k < len(romans_lower):
label = label.replace('%i', romans_lower[major_index + k])
label = label.replace('%I', romans_upper[major_index + k])
label_list.append(label)
k += 1
fig.tags_major_index = major_index + k
Expand Down

0 comments on commit 50aed67

Please sign in to comment.