Skip to content

Commit 25554d8

Browse files
Merge pull request #155 from AndySum/master
Support for setting the ylabel on secondary "addplot"
2 parents 29d82bc + 6c13bc5 commit 25554d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mplfinance/plotting.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ def plot( data, **kwargs ):
512512
else:
513513
ax = panels.at[panid,'axes'][0]
514514

515+
if (apdict["ylabel"] is not None):
516+
ax.set_ylabel(apdict["ylabel"])
515517

516518
aptype = apdict['type']
517519
if aptype == 'scatter':
@@ -702,7 +704,10 @@ def _valid_addplot_kwargs():
702704
all([isinstance(v,(int,float)) for v in value]) },
703705

704706
'secondary_y' : { 'Default' : 'auto',
705-
'Validator' : lambda value: isinstance(value,bool) or value == 'auto' }
707+
'Validator' : lambda value: isinstance(value,bool) or value == 'auto' },
708+
709+
'ylabel' : { 'Default' : None,
710+
'Validator' : lambda value: isinstance(value,str) },
706711
}
707712

708713
_validate_vkwargs_dict(vkwargs)

0 commit comments

Comments
 (0)