Chaco의 시계열 갭을 다루는 것
-
13-12-2019 - |
문제
시장이 폐쇄 될 때 간격이있는 데이터의 표준 재무 시간이 있습니다.
문제는 "nofollow"> Chaco/ "> chaco/ 이러한 격차를 표시합니다. Matplotlib에서 다음과 같이 MatplotLib에서 포맷터를 사용할 수 있습니다.그리고 x 축에 적용하여이 일을 돌아 다니지 만 내가 이것에 대해 내가해야 할 일은 Chaco에서 무엇을 해야할지 알지 못합니다.
matplotlib :
class MyFormatter(Formatter):
def __init__(self, dates, fmt='%Y-%m-%d %H:%M'):
self.dates = dates
self.fmt = fmt
def __call__(self, x, pos=0):
'Return the label for time x at position pos'
ind = int(round(x))
if ind>=len(self.dates) or ind<0: return ''
return self.dates[ind].strftime(self.fmt)
.
Chaco에서 이것을 구현하는 효율적인 방법은 무엇입니까? 감사합니다
해결책
이 다음과 같은 매개 변수를 전달합니다
from enthought.chaco.scales.formatters import TimeFormatter
TimeFormatter._formats['days'] = ('%d/%m', '%d%a',)
. 제휴하지 않습니다 StackOverflow