Skip to content

Commit c09265f

Browse files
committed
mpf now accepts alpha parameter as list for [hvat]lines so it is possible to set a different alpha for each line. I also imported matplotlib.pyplot as plt to solve a unresolved reference on function _mscatter(x,y,ax=None, m=None, **kw)
1 parent 59b42e8 commit c09265f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/mplfinance/_utils.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ def _valid_pnf_kwargs():
438438

439439

440440
def _valid_lines_kwargs():
441-
442441
'''
443442
Construct and return the "valid lines (hlines,vlines,alines,tlines) kwargs table"
444443
for the mplfinance.plot() `[h|v|a|t]lines=` kwarg functions.
@@ -504,12 +503,12 @@ def _valid_lines_kwargs():
504503
or isinstance(value,(float,int))
505504
or all([isinstance(v,(float,int)) for v in value]) },
506505

507-
'alpha' : { 'Default' : 1.0,
508-
'Description' : 'Opacity of [hvat]lines (or sequence of opacities,'
509-
+ 'if each line is to have a different opacity)'
510-
+ 'float from 0.0 to 1.0 '+' (1.0 means fully opaque; 0.0 means transparent.',
511-
'Validator' : lambda value: isinstance(value,(float,int))
512-
or all([isinstance(v, (float, int)) for v in value]) },
506+
'alpha': {'Default': 1.0,
507+
'Description': 'Opacity of [hvat]lines (or sequence of opacities,'
508+
+ 'if each line is to have a different opacity)'
509+
+ 'float from 0.0 to 1.0 ' + ' (1.0 means fully opaque; 0.0 means transparent.',
510+
'Validator': lambda value: isinstance(value, (float, int))
511+
or all([isinstance(v, (float, int)) for v in value])},
513512

514513

515514
'tline_use' : { 'Default' : 'close',

0 commit comments

Comments
 (0)