themes: style once, plot everywhere
Project description
themes
themes: style once, plot everywhere
Universal theme styling across the different python visualization libraries. The package also contains out-of-the-box themes (e.g., a financial news theme) for instant use.
Quickstart
import themes
from themes import datasets
themes.register()
markets = datasets.load_markets()
with alt.themes.enable('capon'):
chart = alt.Chart(markets).mark_line().encode(
x=alt.X('timestamp', title=None, axis=alt.Axis(format="%b %y")),
y=alt.Y('relative_price', title="Relative Price", axis=alt.Axis(format='+%')),
color='symbol',
tooltip=['timestamp', 'symbol', alt.Tooltip('relative_price', format='+.2%')],
).properties(
title={
"text": f"Market Indexes Change",
"subtitle": f"Relative to {markets['timestamp'].dt.date.min()}",
},
with plt.style.context('capon'):
markets.pivot_table(index='timestamp', columns='symbol', values='relative_price').plot()
The full example in a live notebook is provided below.
Installing
Install latest release version via pip
$ pip install themes
Install latest development version via pip
pip install git+https://github.com/gialdetti/themes.git
Install latest development version in development mode
git clone git@github.com:gialdetti/themes.git
cd themes
pip install -e .
Help and Support
Examples
All examples are located in examples folder.
Theme | MyBinder | Colab |
---|---|---|
Markets |
Testing
After installation, you can launch the test suite:
$ pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
themes-0.0.4.tar.gz
(280.8 kB
view hashes)
Built Distribution
themes-0.0.4-py3-none-any.whl
(279.4 kB
view hashes)