Skip to content
Merged
Changes from 1 commit
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
14 changes: 12 additions & 2 deletions src/mplfinance/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,13 @@ def _addplot_columns(panid,panels,ydata,apdict,xdates,config):
mark = apdict['marker']
color = apdict['color']
alpha = apdict['alpha']
edgecolors = apdict['edgecolors']
linewidths = apdict['linewidths']

if isinstance(mark,(list,tuple,np.ndarray)):
_mscatter(xdates,ydata,ax=ax,m=mark,s=size,color=color,alpha=alpha)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markus- Do you see any reason not to also add edgecolors=edgecolors, linewidths=linewidths to the call to _mscatter(). If you look at the code for mscatter() it will simply pass those kwargs down to scatter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DanielGoldfarb, never thought about it, but of course.

else:
ax.scatter(xdates,ydata,s=size,marker=mark,color=color,alpha=alpha)
ax.scatter(xdates, ydata, s=size, marker=mark, color=color, alpha=alpha, edgecolors=edgecolors, linewidths=linewidths)
elif aptype == 'bar':
width = 0.8 if apdict['width'] is None else apdict['width']
bottom = apdict['bottom']
Expand Down Expand Up @@ -1026,6 +1029,7 @@ def _valid_addplot_kwargs():
valid_linestyles = ('-','solid','--','dashed','-.','dashdot','.','dotted',None,' ','')
valid_types = ('line','scatter','bar', 'ohlc', 'candle','step')
valid_stepwheres = ('pre','post','mid')
valid_edgecolors = ('face', 'none', None)

vkwargs = {
'scatter' : { 'Default' : False,
Expand Down Expand Up @@ -1053,7 +1057,13 @@ def _valid_addplot_kwargs():
'linestyle' : { 'Default' : None,
'Validator' : lambda value: value in valid_linestyles },

'width' : { 'Default' : None, # width of `bar` or `line`
'linewidths': {'Default': None,
'Validator' : lambda value: isinstance(value,(int,float)) },

'edgecolors': {'Default': None,
'Validator': lambda value: mcolors.is_color_like(value) or value in valid_edgecolors},

'width' : { 'Default' : None, # width of `bar` or `line`
'Validator' : lambda value: isinstance(value,(int,float)) or
all([isinstance(v,(int,float)) for v in value]) },

Expand Down