никак не могу избавиться от значения осей на графике. Мне нужная только картинка графика.сохранять изображение умею, не могу убрать значения и сменить весь фон на черный.
from numpy import genfromtxt
import mpl_finance
window_size=60
DATA_FOLDER = 'C:\\DataSet'
data_buy = genfromtxt(DATA_FOLDER+'/BASE.csv', encoding='utf-16', delimiter='\t' ,dtype=str)
data_buy = np.flipud(data_buy)
def generateFXTimeS():
for i in range(20):
direction = 'ok'
open = []
high = []
low = []
close = []
volume = []
open2 = []
high2 = []
low2 = []
close2 = []
volume2 = []
date = []
start=i*window_size
for start in range(start,start+window_size,1):
open.append(float(data_buy[start][1]))
high.append(float(data_buy[start][2]))
low.append(float(data_buy[start][3]))
close.append(float(data_buy[start][4]))
volume.append(float(data_buy[start][5]))
open2.append(float(data_buy[start][6]))
high2.append(float(data_buy[start][7]))
low2.append(float(data_buy[start][8]))
close2.append(float(data_buy[start][9]))
volume2.append(float(data_buy[start][10]))
date.append(data_buy[start][0])
sma = convolve_sma(close,9)
smb = list(sma)
diff = sma[-1] - sma[-2]
for x in range(len(close)-len(smb)):
smb.append(smb[-1]+diff)
sma2 = convolve_sma(close, 21)
smb2 = list(sma2)
diff = sma2[-1] - sma2[-2]
for x in range(len(close)-len(smb2)):
smb2.append(smb2[-1]+diff)
sma3 = convolve_sma(close, 31)
smb3 = list(sma3)
diff = sma3[-1] - sma3[-2]
for x in range(len(close)-len(smb3)):
smb3.append(smb3[-1]+diff)
fig = plt.figure(figsize=(3, 3), dpi=50, facecolor='w', edgecolor='k')
fig.set_facecolor("Black")
plt.axis('off')
fig.patch.set_visible(False)
#dx = fig.add_subplot(111)
dx=fig.add_subplot(111, label="1")
dx2=fig.add_subplot(111, label="2", frame_on=False)
dx3=fig.add_subplot(111, label="3", frame_on=False)
dx4=fig.add_subplot(111, label="4", frame_on=False)
dx5=fig.add_subplot(111, label="5", frame_on=False)
mpl_finance.candlestick2_ochl(dx,open, close, high, low, width=1.5, colorup='r', colordown='g', alpha=0.5)
mpl_finance.candlestick2_ochl(dx2,open2, close2, high2, low2, width=1.5, colorup='gray', colordown='gray', alpha=0.5)
plt.autoscale()
dx3.plot(smb, color="blue", linewidth=5, alpha=0.5)
dx4.plot(smb2, color="red", linewidth=5, alpha=0.5)
dx5.plot(smb3, color="orange", linewidth=5, alpha=0.5)
plt.axis('off')
#plt.savefig( os.path.join(train_output_dir,str(direction) +'_{}.jpg'.format(i+i)),bbox_inches='tight')
plt.show()
open.clear()
close.clear()
volume.clear()
high.clear()
low.clear()
plt.cla()
plt.clf()
plt.close(fig)
if __name__ == '__main__': generateFXTimeS()