@@ -349,14 +349,10 @@ def plot( data, **kwargs ):
349
349
350
350
avg_dist_between_points = (xdates [- 1 ] - xdates [0 ]) / float (len (xdates ))
351
351
if not config ['tight_layout' ]:
352
- #print('plot: xdates[-1]=',xdates[-1])
353
- #print('plot: xdates[ 0]=',xdates[ 0])
354
- #print('plot: len(xdates)=',len(xdates))
355
- #print('plot: avg_dist_between_points =',avg_dist_between_points)
356
352
minx = xdates [0 ] - avg_dist_between_points
357
353
maxx = xdates [- 1 ] + avg_dist_between_points
358
354
else :
359
- minx = xdates [0 ] - (0.45 * avg_dist_between_points )
355
+ minx = xdates [0 ] - (0.45 * avg_dist_between_points )
360
356
maxx = xdates [- 1 ] + (0.45 * avg_dist_between_points )
361
357
362
358
if len (xdates ) == 1 : # kludge special case
@@ -371,11 +367,6 @@ def plot( data, **kwargs ):
371
367
372
368
miny = np .nanmin (_lows )
373
369
maxy = np .nanmax (_highs )
374
- #if len(xdates) > 1:
375
- # stdy = (stat.stdev(_lows) + stat.stdev(_highs)) / 2.0
376
- #else: # kludge special case
377
- # stdy = 0.02 * math.fabs(maxy - miny)
378
- # print('minx,miny,maxx,maxy,stdy=',minx,miny,maxx,maxy,stdy)
379
370
380
371
if config ['set_ylim' ] is not None :
381
372
axA1 .set_ylim (config ['set_ylim' ][0 ], config ['set_ylim' ][1 ])
@@ -397,7 +388,8 @@ def plot( data, **kwargs ):
397
388
if config ['volume' ]:
398
389
retdict [prekey + '_volumes' ] = volumes
399
390
if mavgs is not None :
400
- for i in range (0 , len (mavgs )):
391
+ # This is WRONG! Returning the same mavprices for all mavgs ??!
392
+ for i in range (0 , len (mavgs )):
401
393
retdict ['mav' + str (mavgs [i ])] = mavprices
402
394
retdict ['minx' ] = minx
403
395
retdict ['maxx' ] = maxx
@@ -669,19 +661,17 @@ def plot( data, **kwargs ):
669
661
670
662
if config ['axisoff' ]:
671
663
for ax in axlist :
672
- ax .set_xlim (xdates [0 ],xdates [- 1 ])
673
664
ax .set_axis_off ()
674
665
675
666
if config ['savefig' ] is not None :
676
667
save = config ['savefig' ]
677
668
if isinstance (save ,dict ):
678
- # Expand to fill chart if axisoff
679
- if config ['axisoff' ] and 'bbox_inches' not in save :
669
+ if config ['tight_layout' ] and 'bbox_inches' not in save :
680
670
plt .savefig (** save ,bbox_inches = 'tight' )
681
671
else :
682
672
plt .savefig (** save )
683
673
else :
684
- if config ['axisoff ' ]:
674
+ if config ['tight_layout ' ]:
685
675
plt .savefig (save ,bbox_inches = 'tight' )
686
676
else :
687
677
plt .savefig (save )
0 commit comments