Я новичок в python и пытаюсь построить трехмерную гистограмму.
Однако я продолжаю сталкиваться с проблемой ошибки типа.
По сути, я хочу построить дату, скорректированнуюцена и объем закрытия на том же графике.
Данные здесь:
Дата, открытие, максимум, минимум, закрытие, корректировка закрытия, объем
2018-09-05,110.580002,110,820000,109.699997,109.870003,109.870003,6388300
2018-09-06,110.000000,110.410004,109.360001,110.260002,110.260002,5267200
2018-09-07,110.080002,111,340110,9001012010000000004754800
2018-09-10,111.440002,111.910004,110.370003,110.680000,110.680000,4636500
Может кто-нибудь мне помочь?
Код здесь:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import style
import matplotlib.dates as dates
import datetime, random
import matplotlib.ticker as ticker
def random_date():
date = datetime.date(2008, 12, 1)
while 1:
date += datetime.timedelta(days=30)
yield (date)
fig = plt.figure()
ax = Axes3D(fig,rect=[0,0.1,1,1])
ax.bar(date_list, ad_close, zs=vol, zdir = 'y', width = 8 )
ax.w_xaxis.set_major_locator(ticker.FixedLocator(date)) # I want all the dates on my xaxis
ax.w_xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
for tl in ax.w_xaxis.get_ticklabels(): #re-create what autofmt_xdate but with w_xaxis
tl.set_ha('right')
tl.set_rotation(30)
ax.set_ylabel('Adj Close')
ax.set_zlabel('Volume')
plt.show()