Skip to content

plot: linestyle list is accepted #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/mplfinance/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ def _valid_lines_kwargs():
( isinstance(value,(list,tuple)) and
all([mcolors.is_color_like(v) for v in value]) ) },
'linestyle' : { 'Default' : '-',
'Validator' : lambda value: value is None or value in valid_linestyles },
'Validator' : lambda value: value is None or value in valid_linestyles or
all([v in valid_linestyles for v in value]) },
'linewidths': { 'Default' : None,
'Validator' : lambda value: value is None or
isinstance(value,(float,int)) or
Expand Down Expand Up @@ -1124,7 +1125,7 @@ def _construct_aline_collections(alines, dtix=None):
'alines' : the same as defined above: sequence of price, or dates, or segments
'colors' : colors for the above alines
'linestyle' : line types for the above alines
'linewidths' : line types for the above alines
'linewidths' : line widths for the above alines

dtix: date index for the x-axis, used for converting the dates when
x-values are 'evenly spaced integers' (as when skipping non-trading days)
Expand Down Expand Up @@ -1174,7 +1175,7 @@ def _construct_hline_collections(hlines,minx,maxx):
'hlines' : the same as defined above: sequence of price, or dates, or segments
'colors' : colors for the above hlines
'linestyle' : line types for the above hlines
'linewidths' : line types for the above hlines
'linewidths' : line widths for the above hlines

minx : the minimum value for x for the horizontal line, already converted to `xdates` format
maxx : the maximum value for x for the horizontal line, already converted to `xdates` format
Expand Down Expand Up @@ -1234,7 +1235,7 @@ def _construct_vline_collections(vlines,dtix,miny,maxy):
'vlines' : the same as defined above: sequence of dates/datetimes
'colors' : colors for the above vlines
'linestyle' : line types for the above vlines
'linewidths' : line types for the above vlines
'linewidths' : line widths for the above vlines

dtix: date index for the x-axis, used for converting the dates when
x-values are 'evenly spaced integers' (as when skipping non-trading days)
Expand Down Expand Up @@ -1300,7 +1301,7 @@ def _construct_tline_collections(tlines, dtix, dates, opens, highs, lows, closes
'tlines' : the same as defined above: sequence of pairs of date[time]s
'colors' : colors for the above tlines
'linestyle' : line types for the above tlines
'linewidths' : line types for the above tlines
'linewidths' : line widths for the above tlines

dtix: date index for the x-axis, used for converting the dates when
x-values are 'evenly spaced integers' (as when skipping non-trading days)
Expand Down
2 changes: 1 addition & 1 deletion src/mplfinance/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

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

Expand Down