The first problem is there are multiples (12 or 24 when zoom in to maximum) ticks of the same day on the axis and the glyph is plotted along only one tick. I want to have one tick a day.
Additionally, is there a way to adjust the distance between the first tick on x axis and y axis. At the moment the first tick is at y axis so the tick label is missing as well.
The reason there are duplicates (I assume) is because the formatter is only showing ticks up to the resolution of days, but when the range only spans a day or two, there are many ticks generated at different hours of the same day.
I guess it really depends on what you are actually trying to achieve:
Do you really only want at most one-tick per day (no intra-day ticks?) Then you could
# x axis get updated every time d_start changes
def update(...):
d_range = pd.date_range(d_start, periods=30, freq='D').date.tolist()
p.x_range.start = d_range[0]
p.x_range.end = d_range[-1]
p.xaxis[0].ticker = DatetimeTicker(desired_num_ticks=len(d_range), tags=d_range)
p.xgrid[0].ticker = DatetimeTicker(desired_num_ticks=len(d_range), tags=d_range)
The first problem is there are multiples (12 or 24 when zoom in to maximum) ticks of the same day on the axis and the glyph is plotted along only one tick. I want to have one tick a day.
Additionally, is there a way to adjust the distance between the first tick on x axis and y axis. At the moment the first tick is at y axis so the tick label is missing as well.
It works when I set ticker property of DatetimeTicker as tickers=[DaysTicker(days=list(range(1, ‘a number here’)))] and normailze the dates value using pd.datetools.normalize_date
···
On Friday, July 15, 2016 at 5:51:59 PM UTC-7, Caroline Wang wrote:
Hi,
I’m trying to create a plot where x coordinates are datetime.date objects and y are integers. The code looks like this:
The first problem is there are multiples (12 or 24 when zoom in to maximum) ticks of the same day on the axis and the glyph is plotted along only one tick. I want to have one tick a day.
Additionally, is there a way to adjust the distance between the first tick on x axis and y axis. At the moment the first tick is at y axis so the tick label is missing as well.