@@ -32,8 +32,9 @@ def test_addplot01(bolldata):
32
32
tname = os .path .join (tdir ,fname )
33
33
rname = os .path .join (refd ,fname )
34
34
35
- mpf .plot (df ,volume = True ,savefig = tname )
36
-
35
+ fig_axis = mpf .plot (df ,volume = True ,savefig = tname ,returnfig = True )
36
+ plt .close (fig_axis [0 ])
37
+
37
38
tsize = os .path .getsize (tname )
38
39
print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
39
40
@@ -53,7 +54,8 @@ def test_addplot02(bolldata):
53
54
rname = os .path .join (refd ,fname )
54
55
55
56
apdict = mpf .make_addplot (df ['LowerB' ])
56
- mpf .plot (df ,volume = True ,addplot = apdict ,savefig = tname )
57
+ fig_axis = mpf .plot (df ,volume = True ,addplot = apdict ,savefig = tname ,returnfig = True )
58
+ plt .close (fig_axis [0 ])
57
59
58
60
tsize = os .path .getsize (tname )
59
61
print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
@@ -108,7 +110,8 @@ def test_addplot03(bolldata):
108
110
mpf .make_addplot ((df ['PercentB' ]),panel = 'lower' ,color = 'g' )
109
111
]
110
112
111
- mpf .plot (df ,addplot = apds ,figscale = 1.3 ,volume = True ,savefig = tname )
113
+ fig_axis = mpf .plot (df ,addplot = apds ,figscale = 1.3 ,volume = True ,savefig = tname ,returnfig = True )
114
+ plt .close (fig_axis [0 ])
112
115
113
116
tsize = os .path .getsize (tname )
114
117
print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
@@ -139,8 +142,9 @@ def test_addplot04(bolldata):
139
142
mpf .make_addplot ((df ['PercentB' ]),panel = 'lower' ,color = 'g' ,linestyle = 'dotted' )
140
143
]
141
144
142
- mpf .plot (df ,addplot = apds ,figscale = 1.5 ,volume = True ,
143
- style = 'starsandstripes' ,savefig = tname )
145
+ fig_axis = mpf .plot (df ,addplot = apds ,figscale = 1.5 ,volume = True ,
146
+ style = 'starsandstripes' ,savefig = tname ,returnfig = True )
147
+ plt .close (fig_axis [0 ])
144
148
145
149
tsize = os .path .getsize (tname )
146
150
print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
0 commit comments