I'm trying to make a specific plot using ggplot/plotnine. I'd like to keep it plotnine if possible so everything I've done can stay in the same notebook.
Essentially I want to create a box/jitter plot that allows for separation by category or further jitters by category.
The data I am working with evaluates 4 different models and their percent error based on a specific metric. Structure of data is below.
Data:
Model metric Percent Error
0 gbr Lower 46.533009
1 gbr Lower 22.654213
2 gbr Lower 17.404358
3 gbr Lower 5.134485
4 gbr Lower 4.550838
... ... ... ...
9963 cqrn Average 5.745320
9964 cqrn Average 16.465810
9965 cqrn Average 14.737193
9966 cqrn Average 81.743560
9967 cqrn Average 73.008793
Code:
(ggplot(dat,aes(x="metric",
y="Percent Error",
color = "Model")) +
geom_jitter(width = .25,alpha=.4,show_legend=False) +
scale_y_log10() +
labs(title=f"Error Metrics"))
I want to have a graph that looks like this (sorry for the crude drawing). This can be down with box plots or jitters - although bonus points for jitter if you can!