Skip to content

Commit 6e88cbd

Browse files
author
Michal Kucharczyk
committed
plot: linestyle list is accepted
The linestyle argument for alines,tlines,vlines can now be the list. Minor typos corrected.
1 parent d777f43 commit 6e88cbd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/mplfinance/_utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ def _valid_lines_kwargs():
427427
( isinstance(value,(list,tuple)) and
428428
all([mcolors.is_color_like(v) for v in value]) ) },
429429
'linestyle' : { 'Default' : '-',
430-
'Validator' : lambda value: value is None or value in valid_linestyles },
430+
'Validator' : lambda value: value is None or value in valid_linestyles or
431+
all([v in valid_linestyles for v in value]) },
431432
'linewidths': { 'Default' : None,
432433
'Validator' : lambda value: value is None or
433434
isinstance(value,(float,int)) or
@@ -1124,7 +1125,7 @@ def _construct_aline_collections(alines, dtix=None):
11241125
'alines' : the same as defined above: sequence of price, or dates, or segments
11251126
'colors' : colors for the above alines
11261127
'linestyle' : line types for the above alines
1127-
'linewidths' : line types for the above alines
1128+
'linewidths' : line widths for the above alines
11281129
11291130
dtix: date index for the x-axis, used for converting the dates when
11301131
x-values are 'evenly spaced integers' (as when skipping non-trading days)
@@ -1174,7 +1175,7 @@ def _construct_hline_collections(hlines,minx,maxx):
11741175
'hlines' : the same as defined above: sequence of price, or dates, or segments
11751176
'colors' : colors for the above hlines
11761177
'linestyle' : line types for the above hlines
1177-
'linewidths' : line types for the above hlines
1178+
'linewidths' : line widths for the above hlines
11781179
11791180
minx : the minimum value for x for the horizontal line, already converted to `xdates` format
11801181
maxx : the maximum value for x for the horizontal line, already converted to `xdates` format
@@ -1234,7 +1235,7 @@ def _construct_vline_collections(vlines,dtix,miny,maxy):
12341235
'vlines' : the same as defined above: sequence of dates/datetimes
12351236
'colors' : colors for the above vlines
12361237
'linestyle' : line types for the above vlines
1237-
'linewidths' : line types for the above vlines
1238+
'linewidths' : line widths for the above vlines
12381239
12391240
dtix: date index for the x-axis, used for converting the dates when
12401241
x-values are 'evenly spaced integers' (as when skipping non-trading days)
@@ -1300,7 +1301,7 @@ def _construct_tline_collections(tlines, dtix, dates, opens, highs, lows, closes
13001301
'tlines' : the same as defined above: sequence of pairs of date[time]s
13011302
'colors' : colors for the above tlines
13021303
'linestyle' : line types for the above tlines
1303-
'linewidths' : line types for the above tlines
1304+
'linewidths' : line widths for the above tlines
13041305
13051306
dtix: date index for the x-axis, used for converting the dates when
13061307
x-values are 'evenly spaced integers' (as when skipping non-trading days)

0 commit comments

Comments
 (0)