axis formatter and tick locator not functioning properly

Hello,

I am struggling for the last few days to get my xaxis properties right. Right now it shows the date2num value and if I change the formatter to DatetimeTickFormatter it gives weird formats like 700us.

With matplotlib it worked fine like this:

loc = matplotlib.dates.HourLocator()

formatter = matplotlib.dates.DateFormatter("%H:%M")

ax.xaxis.set_major_locator(loc)

ax.xaxis.set_major_formatter(formatter)

labelsx = ax.get_xticklabels()

With Bokeh I tried many things where this is the most logic to me:

p=Figure(title=“Ganttchart”, tools=TOOLS, x_range=[min(self.at),max(self.dt)],y_range = y_range)

xaxis = DatetimeAxis(formatter=DatetimeTickFormatter(formats=dict(hours=["%H"])))

p.add_layout(xaxis, “below”)

It still does not provide the wanted axes, also with the auto function of DatetimeTickFormatter it does not work.

Can someone please give me a direction to go, because 2 days of googling did not gave the result:( and I really want my nice interactive plot.

Kind regards,

Jakko

Does someone had this problem before and fixed it? Help would be appreciated!

Jakko

···

Op donderdag 2 juli 2015 17:11:12 UTC+2 schreef jakko deken:

Hello,

I am struggling for the last few days to get my xaxis properties right. Right now it shows the date2num value and if I change the formatter to DatetimeTickFormatter it gives weird formats like 700us.

With matplotlib it worked fine like this:

loc = matplotlib.dates.HourLocator()

formatter = matplotlib.dates.DateFormatter("%H:%M")

ax.xaxis.set_major_locator(loc)

ax.xaxis.set_major_formatter(formatter)

labelsx = ax.get_xticklabels()

With Bokeh I tried many things where this is the most logic to me:

p=Figure(title=“Ganttchart”, tools=TOOLS, x_range=[min(self.at),max(self.dt)],y_range = y_range)

xaxis = DatetimeAxis(formatter=DatetimeTickFormatter(formats=dict(hours=["%H"])))

p.add_layout(xaxis, “below”)

It still does not provide the wanted axes, also with the auto function of DatetimeTickFormatter it does not work.

Can someone please give me a direction to go, because 2 days of googling did not gave the result:( and I really want my nice interactive plot.

Kind regards,

Jakko