Bokehのscatter
関数を使用するときにログスケールを取得するにはどうすればよいですか。私は次のようなものを探しています:
scatter(x, y, source=my_source, ylog=True)
または
scatter(x, y, source=my_source, yscale='log')
これらの線に沿った何かが機能します:
import numpy as np
from bokeh.plotting import *
N = 100
x = np.linspace(0.1, 5, N)
output_file("logscatter.html", title="log axis scatter example")
figure(tools="pan,wheel_zoom,box_zoom,reset,previewsave",
y_axis_type="log", y_range=[0.1, 10**2], title="log axis scatter example")
scatter(x, np.sqrt(x), line_width=2, line_color="yellow", legend="y=sqrt(x)")
show()
別の方法として、図の代わりに散布図で「ログ」関連のパラメーターを渡すこともできます(ただし、上記のように記述することをお勧めします)。
scatter(x, np.sqrt(x), y_axis_type="log", y_range=[0.1, 10**2], line_width=2, line_color="yellow", legend="y=sqrt(x)")
それが役に立てば幸い!;-)
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加