网格线绘制在刻度线的位置,因此要调整网格线,您可以调整刻度线。例如:
import altair as alt
import numpy as np
import pandas as pd
x = np.arange(100)
source = pd.DataFrame({
'x': x,
'f(x)': np.sin(x / 5)
})
alt.Chart(source).mark_line().encode(
x=alt.X('x', axis=alt.Axis(tickCount=4)),
y='f(x)'
)
Run Code Online (Sandbox Code Playgroud)
您可以在 的文档中查看其他与刻度相关的属性alt.Axis。
| 归档时间: |
|
| 查看次数: |
1961 次 |
| 最近记录: |