Created
August 25, 2019 06:45
-
-
Save Ken-Kuroki/b03ecf5857fe31f510a9ba853c3fc6f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plotting in dark theme with Altair | |
import numpy as np | |
import pandas as pd | |
import altair as alt | |
alt.renderers.set_embed_options(theme='dark') | |
arr = np.concatenate([np.random.randn(100, 2), np.random.randint(0, 5, (100, 1))], axis=1) | |
df = pd.DataFrame(arr, columns=["X1", "X2", "Y"]) | |
alt.Chart(df).mark_circle().encode( | |
x="X1", | |
y="X2", | |
color=alt.Color("Y:N", scale=alt.Scale(scheme="set2")), # accent, set2, and set3 are my favorite schemes with dark theme | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the output