@@ -264,7 +264,7 @@ def plot( data, **kwargs ):
264264 collections = _construct_ohlc_collections (xdates , opens , highs , lows , closes ,
265265 marketcolors = style ['marketcolors' ] )
266266 elif ptype == 'renko' :
267- collections , new_dates , volumes , brick_values = _construct_renko_collections (dates , highs , lows , volumes , config ['renko_params' ], closes ,
267+ collections , new_dates , volumes , brick_values , brick_size = _construct_renko_collections (dates , highs , lows , volumes , config ['renko_params' ], closes ,
268268 marketcolors = style ['marketcolors' ] )
269269
270270 formatter = IntegerIndexDateTimeFormatter (new_dates , fmtstring )
@@ -316,8 +316,12 @@ def plot( data, **kwargs ):
316316 avg_dist_between_points = (xdates [- 1 ] - xdates [0 ]) / float (len (xdates ))
317317 minx = xdates [0 ] - avg_dist_between_points
318318 maxx = xdates [- 1 ] + avg_dist_between_points
319- miny = min ([low for low in lows if low != - 1 ])
320- maxy = max ([high for high in highs if high != - 1 ])
319+ if ptype is not 'renko' :
320+ miny = min ([low for low in lows if low != - 1 ])
321+ maxy = max ([high for high in highs if high != - 1 ])
322+ else :
323+ miny = min ([brick for brick in brick_values ])
324+ maxy = max ([brick + brick_size for brick in brick_values ])
321325 corners = (minx , miny ), (maxx , maxy )
322326 ax1 .update_datalim (corners )
323327
0 commit comments