import pandas
as pd
import matplotlib
.pyplot
as plt
import mpl_finance
as mpf
def candi_draw(dataframe
,path
,filename
,num
):
fig
, ax
= plt
.subplots
(figsize
=(6,4))
fig
.subplots_adjust
(bottom
=0.2)
mpf
.candlestick2_ohlc
(ax
,dataframe
['OPEN'], dataframe
['HIGH'],
dataframe
['LOW'],dataframe
['CLOSE'], width
=0.9,
colorup
='r',colordown
='g')
ax
.autoscale_view
()
fig
= plt
.gcf
()
fig
.savefig
(path
+ '{}-{}.jpg'.format(filename
,num
),bbox_inches
= 'tight')
plt
.close
()
转载请注明原文地址: https://www.6miu.com/read-5038182.html