请考虑以下散点图示例 .
import bokeh
from bokeh.charts import Scatter, output_file, show
from bokeh.models import HoverTool
p = Scatter(df, x='colA', y='colB', title="Foo", color="navy",
xlabel="A", ylabel="B", tools="hover")
我想更改一个轴的刻度标签的格式:
当我尝试:
p.xaxis[0].formatter = NumeralTickFormatter(format="0.0%")
我明白了:
Chart object has no attribute xaxis
为什么?如何访问图表的图形?
1 回答
你要做
p._xaxis.formatter = NumeralTickFormatter(format="0.0%")