https://github.com/datadesk/altair-latimes
A Los Angeles Times theme for Python's Altair statistical visualization library
https://github.com/datadesk/altair-latimes
altair data-journalism data-visualization journalism jupyter-notebook news python
Last synced: 9 days ago
JSON representation
A Los Angeles Times theme for Python's Altair statistical visualization library
- Host: GitHub
- URL: https://github.com/datadesk/altair-latimes
- Owner: datadesk
- License: mit
- Created: 2019-02-24T00:51:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T19:11:51.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T10:21:25.104Z (26 days ago)
- Topics: altair, data-journalism, data-visualization, journalism, jupyter-notebook, news, python
- Language: Jupyter Notebook
- Size: 1.43 MB
- Stars: 12
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vega - altair-latimes - Los Angeles Times theme. (Altair / Packages)
README
# altair-latimes
A Los Angeles Times theme for Python's Altair statistical visualization library
### Getting started
Install from PyPI.
```bash
$ pip install altair-latimes
```Import with Altair.
```python
import altair as alt
import altair_latimes as lat
```Register and enable the theme.
```python
alt.themes.register('latimes', lat.theme)
alt.themes.enable('latimes')
```Make a chart.
```python
from vega_datasets import data
source = data.iowa_electricity()alt.Chart(source, title="Iowa's renewable energy boom").mark_area().encode(
x=alt.X(
"year:T",
title="Year"
),
y=alt.Y(
"net_generation:Q",
stack="normalize",
title="Share of net generation",
axis=alt.Axis(format=".0%"),
),
color=alt.Color(
"source:N",
legend=alt.Legend(title="Electricity source"),
)
)
```
### What else?
This library requires that you have both the "Benton Gothic" and "Benton Gothic Bold" fonts installed. More examples can be found in [notebook.ipynb](./notebook.ipynb).