Skip to content

Commit ed7be21

Browse files
Merge branch 'master' of github.com:matplotlib/mplfinance to include AndySum's change for ylabels on addplots
2 parents 50e816e + 25554d8 commit ed7be21

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
@@ -515,6 +515,8 @@ def plot( data, **kwargs ):
515515
else:
516516
ax = panels.at[panid,'axes'][0]
517517

518+
if (apdict["ylabel"] is not None):
519+
ax.set_ylabel(apdict["ylabel"])
518520

519521
aptype = apdict['type']
520522
if aptype == 'scatter':
@@ -711,7 +713,10 @@ def _valid_addplot_kwargs():
711713
all([isinstance(v,(int,float)) for v in value]) },
712714

713715
'secondary_y' : { 'Default' : 'auto',
714-
'Validator' : lambda value: isinstance(value,bool) or value == 'auto' }
716+
'Validator' : lambda value: isinstance(value,bool) or value == 'auto' },
717+
718+
'ylabel' : { 'Default' : None,
719+
'Validator' : lambda value: isinstance(value,str) },
715720
}
716721

717722
_validate_vkwargs_dict(vkwargs)

0 commit comments

Comments
 (0)