Skip to content

Commit 37b9b83

Browse files
committed
made line color in lineplot customizable
1 parent 6d2638f commit 37b9b83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mplfinance/plotting.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def _valid_plot_kwargs():
9494
and isinstance(value[0],(float,int))
9595
and isinstance(value[1],(float,int)) },
9696

97+
'linecolor' : { 'Default' : 'k', # line color in line plot
98+
'Validator' : lambda value: isinstance(value,str) },
99+
97100
'title' : { 'Default' : None, # Plot Title
98101
'Validator' : lambda value: isinstance(value,str) },
99102

@@ -242,7 +245,7 @@ def plot( data, **kwargs ):
242245
collections = _construct_ohlc_collections(xdates, opens, highs, lows, closes,
243246
marketcolors=style['marketcolors'] )
244247
elif ptype == 'line':
245-
ax1.plot(xdates, closes, color='k')
248+
ax1.plot(xdates, closes, color=config['linecolor'])
246249
else:
247250
raise ValueError('Unrecognized plot type = "'+ptype+'"')
248251

0 commit comments

Comments
 (0)