y 軸の目盛りは、500000000 から 5.000e+8 のような数値をフォーマットしているようです。500000000と表示されるように表示を制御する方法はありますか?
Python 2.7、ボケ0.5.2を使用
ボケチュートリアルページで時系列の例を試しています
チュートリアルは「日付」に対して「Adj Close」をプロットしますが、「日付」に対して「ボリューム」をプロットしています
以下のおもちゃのプロットで使用されている NumeralTickFormatter を使用することもできます。「00」の代わりに使用できるその他の値は、次のとおりです。
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)
p.left[0].formatter.use_scientific = False
オプションをコードに追加する必要があります。時系列のチュートリアルでは、次のようになります。
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))