@@ -924,6 +924,13 @@ def _addplot_columns(panid,panels,ydata,apdict,xdates,config):
924
924
width = apdict ['width' ] if apdict ['width' ] is not None else 1.6 * config ['_width_config' ]['line_width' ]
925
925
alpha = apdict ['alpha' ]
926
926
ax .plot (xdates ,ydata ,linestyle = ls ,color = color ,linewidth = width ,alpha = alpha )
927
+ elif aptype == 'step' :
928
+ stepwhere = apdict ['stepwhere' ]
929
+ ls = apdict ['linestyle' ]
930
+ color = apdict ['color' ]
931
+ width = apdict ['width' ] if apdict ['width' ] is not None else 1.6 * config ['_width_config' ]['line_width' ]
932
+ alpha = apdict ['alpha' ]
933
+ ax .step (xdates ,ydata ,where = stepwhere ,linestyle = ls ,color = color ,linewidth = width ,alpha = alpha )
927
934
else :
928
935
raise ValueError ('addplot type "' + str (aptype )+ '" NOT yet supported.' )
929
936
@@ -1010,7 +1017,8 @@ def _auto_secondary_y( panels, panid, ylo, yhi ):
1010
1017
def _valid_addplot_kwargs ():
1011
1018
1012
1019
valid_linestyles = ('-' ,'solid' ,'--' ,'dashed' ,'-.' ,'dashdot' ,'.' ,'dotted' ,None ,' ' ,'' )
1013
- valid_types = ('line' ,'scatter' ,'bar' , 'ohlc' , 'candle' )
1020
+ valid_types = ('line' ,'scatter' ,'bar' , 'ohlc' , 'candle' ,'step' )
1021
+ valid_stepwheres = ('pre' ,'post' ,'mid' )
1014
1022
1015
1023
vkwargs = {
1016
1024
'scatter' : { 'Default' : False ,
@@ -1070,6 +1078,9 @@ def _valid_addplot_kwargs():
1070
1078
1071
1079
'yscale' : { 'Default' : None ,
1072
1080
'Validator' : lambda value : _yscale_validator (value ) },
1081
+
1082
+ 'stepwhere' : { 'Default' : 'pre' ,
1083
+ 'Validator' : lambda value : value in valid_stepwheres },
1073
1084
}
1074
1085
1075
1086
_validate_vkwargs_dict (vkwargs )
0 commit comments