Data Type |
Shorthand Code |
Description |
quantitative |
Q |
a continuous real-valued quantity |
ordinal |
O |
a discrete ordered quantity |
nominal |
N |
a discrete unordered category |
temporal |
T |
a time or date value |
.. altair-plot::
from altair import Chart, load_dataset, enable_mime_rendering, X, Axis
# load built-in dataset as a pandas DataFrame
barley = load_dataset('barley')
# Uncomment for rendering in JupyterLab & nteract
# enable_mime_rendering()
Chart(barley).mark_bar(barSize=15).encode(
x=X('year:T',
timeUnit='year',
axis=Axis(labelAngle=320,
labelBaseline="bottom",
labelAlign="right",
tickPadding=10,
ticks=2)),
y='sum(yield):Q',
color='site:N'
).configure_cell(
height=200,
width=110)