Skip to content

Commit 9f89676

Browse files
committed
added line spacing parameter
1 parent 3e67724 commit 9f89676

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

lld_chxr.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@
144144
default='white',
145145
help='Color of additional text on the final output (default: white)'
146146
)
147+
parser.add_argument(
148+
'--addLineSpace',
149+
dest='addLineSpace',
150+
type=float,
151+
default=0.5,
152+
help='Line space in additional text on the final output, smaller = tighter (default: 0.5)'
153+
)
147154

148155
# Version
149156
parser.add_argument(
@@ -329,19 +336,22 @@ def add_positioned_text(options, max_x, max_y):
329336
ValueError:
330337
If `options.addTextPos` is not "top" or "bottom".
331338
"""
332-
padding = 50
339+
padding = 100
333340
if options.addTextPos == "top":
334341
x_pos, y_pos = padding, padding + options.addTextSize
335342
elif options.addTextPos == "bottom":
336343
x_pos, y_pos = padding, max_y - padding
337344
else:
338345
raise ValueError("Position must be 'top' or 'bottom'")
346+
347+
# handles multiline text
339348
options.addText = options.addText.replace("\\n", "\n")
340349

341350
plt.text(
342-
x_pos, y_pos, f"{options.addText}",
351+
x_pos, y_pos, options.addText,
343352
color=options.addTextColor,
344-
fontsize=options.addTextSize
353+
fontsize=options.addTextSize,
354+
linespacing=options.addLineSpace
345355
)
346356

347357

0 commit comments

Comments
 (0)