python bokeh绘图如何格式化轴显示

python bokeh绘图如何格式化轴显示,python,bokeh,Python,Bokeh,y轴刻度似乎是在格式化数字,如500000000到5.000e+8。是否有办法控制显示器,使其显示为500000000 使用Python2.7,Bokeh0.5.2 我正在bokeh教程页面上试用timeseries示例 本教程根据“日期”绘制“调整关闭”,但我使用“体积”绘制“日期”您必须在代码中添加选项p.left[0]。formatter.use_scientific=False。在timeseries教程中,应该是: p1 = figure(title="Stocks") p1.line

y轴刻度似乎是在格式化数字,如500000000到5.000e+8。是否有办法控制显示器,使其显示为500000000

使用Python2.7,Bokeh0.5.2

我正在bokeh教程页面上试用timeseries示例


本教程根据“日期”绘制“调整关闭”,但我使用“体积”绘制“日期”

您必须在代码中添加选项
p.left[0]。formatter.use_scientific=False
。在timeseries教程中,应该是:

p1 = figure(title="Stocks")
p1.line(
    AAPL['Date'],
    AAPL['Adj Close'],
    color='#A6CEE3',
    legend='AAPL',
)

p1.left[0].formatter.use_scientific = False # <---- This forces showing 500000000 instead of 5.000e+8 as you want

show(VBox(p1, p2))
p1=图(title=“股票”)
p1.1线(
AAPL[“日期”],
AAPL['Adj Close'],
颜色='#A6CEE3',
图例='AAPL',
)

p1.左[0]。formatter.use_scientific=False#您也可以使用下面的玩具情节中使用的formatter。列出了替代“00”的其他可能值


这是代码的链接。。在将数据放入ColumnDataSource之前,我使用Volume代替Adj Close通过格式化来解决我的问题。这样,可以控制悬停文本格式。但我仍然无法格式化轴显示。。
import pandas as pd
import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import NumeralTickFormatter

df = pd.DataFrame(np.random.randint(0, 90000000000, (10,1)), columns=['my_int'])
p = figure(plot_width=700, plot_height=280, y_range=[0,100000000000])
output_file("toy_plot_with_commas")

for index, record in df.iterrows():
    p.rect([index], [record['my_int']/2], 0.8, [record['my_int']], fill_color="red", line_color="black")

p.yaxis.formatter=NumeralTickFormatter(format="00")
show(p)