Skip to content

Instantly share code, notes, and snippets.

@has2k1
Created November 3, 2022 16:21
import pandas as pd
from plotnine import *
df = pd.DataFrame({'x': range(5), 'y': range(5), 'z': list('ccddf')})
df['z'] = pd.Categorical(df['z'], categories=list('cdf'), ordered=True)
p = (ggplot(df, aes('x', 'y', color='z'))
+ geom_point()
)
p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment