Skip to content

Commit 10095c6

Browse files
Merge pull request #462 from michalkucharczyk/linestyle-list-accepted
plot: linestyle list is accepted
2 parents 5a772a8 + 60609ec commit 10095c6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/mplfinance/_utils.py

+6-5
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)

src/mplfinance/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
version_info = (0, 12, 8, 'beta', 2)
2+
version_info = (0, 12, 8, 'beta', 3)
33

44
_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}
55

0 commit comments

Comments
 (0)