@@ -269,7 +269,7 @@ def plot( data, **kwargs ):
269269 collections = _construct_ohlc_collections (xdates , opens , highs , lows , closes ,
270270 marketcolors = style ['marketcolors' ] )
271271 elif ptype == 'renko' :
272- collections , new_dates , volumes , brick_values = _construct_renko_collections (dates , highs , lows , volumes , config ['renko_params' ], closes ,
272+ collections , new_dates , volumes , brick_values , brick_size = _construct_renko_collections (dates , highs , lows , volumes , config ['renko_params' ], closes ,
273273 marketcolors = style ['marketcolors' ] )
274274 elif ptype == 'pnf' or ptype == 'p&f' or ptype == 'pointnfigure' :
275275 collections , new_dates , volumes , brick_values = _construct_pointnfig_collections (dates , highs , lows , volumes , config ['pointnfig_params' ], closes ,
@@ -325,8 +325,12 @@ def plot( data, **kwargs ):
325325 avg_dist_between_points = (xdates [- 1 ] - xdates [0 ]) / float (len (xdates ))
326326 minx = xdates [0 ] - avg_dist_between_points
327327 maxx = xdates [- 1 ] + avg_dist_between_points
328- miny = min ([low for low in lows if low != - 1 ])
329- maxy = max ([high for high in highs if high != - 1 ])
328+ if ptype is not 'renko' :
329+ miny = min ([low for low in lows if low != - 1 ])
330+ maxy = max ([high for high in highs if high != - 1 ])
331+ else :
332+ miny = min ([brick for brick in brick_values ])
333+ maxy = max ([brick + brick_size for brick in brick_values ])
330334 corners = (minx , miny ), (maxx , maxy )
331335 ax1 .update_datalim (corners )
332336
0 commit comments