-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Labels
Description
It seems like geom_boxplot does not take the weight aesthetic into account.
Expected behavior
Using the weight aesthetic with geom_boxplot weights the values in the dataset.
Actual behavior
geom_boxplot behaves as if weight was passed 1, even when passed a specific column.
Steps to reproduce
Here is a minimal snippet to reproduce the problem:
import pandas as pd
import plotnine as pn
df1 = pd.DataFrame(dict(value=[1,2,3,4,5,6,7,8,9,10], weight=[1,1,1,1,1,2,2,2,2,2]))
df2 = pd.DataFrame(dict(value=[1,2,3,4,5,6,6,7,7,8,8,9,9,10,10]))
plot1 = pn.ggplot(df, pn.aes(x=1, y="value", weight="weight")) + pn.geom_boxplot()
plot2 = pn.ggplot(df2, pn.aes(x=1, y="value")) + pn.geom_boxplot()plot1 gives the same plot as pn.ggplot(df, pn.aes(x=1, y="value")) + pn.geom_boxplot(), when it is expected to give the same plot as plot2.
Specifications
- Version:
plotnine==0.7.1 - Python version:
Python 3.8.2 - Platform:
Ubuntu 20.04.1 LTS
Reactions are currently unavailable