Exemple #1
0
    def setup_datetime(self, index=None):
        """
            Setup the int based matplotlib x-index to translate
            to datetime

            Separated out here to share between plot and candlestick
        """
        if index is None:
            index = self.index

        is_datetime = self.is_datetime()
        if self.formatter is None and self.skip_na and is_datetime:
            self.locator = TimestampLocator(index)
            self.formatter = TimestampFormatter(index, self.locator)
            self.set_formatter()

        # reupdate index
        self.locator.index = index
        self.formatter.index = index