Here I've taken some gapminder.org data and looped through the years to create a series of charts (which I converted to an animated gif in imageio) by modifying the Making Interactive Visualizations with Bokeh notebook.
The problem is that when the Middle Eastern countries float to the top in the 1970s, the y-axis tick marks (and the legend) gets perturbed. I'm keeping as many things as possible out of the year loop when I build the plots, so my y-axis code looks like this:
# Personal income (GDP per capita)
y_low = int(math.floor(income_df.min().min()))
y_high = int(math.ceil(income_df.max().max()))
y_data_range = DataRange1d(y_low-0.5*y_low, 1000000*y_high)
# ...
for year in columns_list:
# ...
# Build the plot
plot = Plot(
# Children per woman (total fertility)
x_range=x_data_range,
# Personal income (GDP per capita)
y_range=y_data_range,
y_scale=LogScale(),
plot_width=800,
plot_height=400,
outline_line_color=None,
toolbar_location=None,
min_border=20,
)
# Build the axes
xaxis = LinearAxis(ticker=SingleIntervalTicker(interval=x_interval),
axis_label="Children per woman (total fertility)",
**AXIS_FORMATS)
yaxis = LogAxis(ticker=LogTicker(),
axis_label="Personal income (GDP per capita)",
**AXIS_FORMATS)
plot.add_layout(xaxis, 'below')
plot.add_layout(yaxis, 'left')
As you can see, I've bumped up the data range by a factor of 10^6 with no effect. Is there some parameter I need to add to keep my y-axis tick marks (and legend) stable?