質問

私は市場が閉じられたときにギャップがあるデータの標準的な金融タイムスを持っています。

問題は 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)
.

これをChacoで実施するための効率的な方法は何でしょうか? ありがとう

役に立ちましたか?

解決

このようなパラメータを渡す

from enthought.chaco.scales.formatters import TimeFormatter
TimeFormatter._formats['days'] = ('%d/%m', '%d%a',)
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top