look¶
champalimaud.look
¶
The look every figure shares: colors and the plotting defaults.
No data and no network.
use_base_look sets the defaults, so a plot states a color, size, or
line width only when its data need it.
type_color(field='type')
¶
Build an altair color encoding from TYPE_COLORS.
altair assigns colors to categories in alphabetical order. This encoding fixes the domain and the colors, with no legend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
Nominal column that holds the type of each mark. |
"type"
|
Returns:
| Type | Description |
|---|---|
Color
|
The encoding, to pass as |
Examples:
Source code in champalimaud/look.py
use_base_look()
¶
Set the matplotlib defaults and enable the altair theme "lab".
The matplotlib color cycle follows TYPE_COLORS, with no top and
right spines, no legend frame, and constrained layout.
The altair theme lab has the same colors.
Examples: