How can you disable scientific output of numbers on an axis in bokeh? For example, I want 400000 and not 4.00e+5
In mpl: ax.get_xaxis().get_major_formatter().set_scientific(False)
You can disable scientific notation with this:
fig = plt.figure(title='xxx', x_axis_type='datetime') fig.left[0].formatter.use_scientific = False
Note that as of Bokeh v0.9.1, Marek's answer will no longer work due to changes in the interface for Charts
. The following code (from GitHub) is a fully-functional example of how to turn off scientific notation in a high level chart.
from bokeh.embed import components from bokeh.models import Axis from bokeh.charts import Bar data = {"y": [6, 7, 2, 4, 5], "z": [1, 5, 12, 4, 2]} bar = Bar(data) yaxis = bar.select(dict(type=Axis, layout="left"))[0] yaxis.formatter.use_scientific = False script, div = components(bar) print(script) print(div)
The key lines are:
yaxis = bar.select(dict(type=Axis, layout="left"))[0] yaxis.formatter.use_scientific = False
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With