我有一个标准的金融时间序列数据,其中有差距,当市场关闭。
问题是Chaco会显示这些间隙,我可以使用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)在查科中实现这一点的有效方法是什么?谢谢
发布于 2012-07-19 22:08:41
像这样传递参数
from enthought.chaco.scales.formatters import TimeFormatter
TimeFormatter._formats['days'] = ('%d/%m', '%d%a',)https://stackoverflow.com/questions/9689586
复制相似问题