Hi, it seems drop parameter of facet_grid() function do not work.
Below is official example:
import pandas as pd
from plotnine import *
from plotnine.data import *
%matplotlib inline
(
ggplot(mpg, aes(x='displ', y='hwy'))
+ geom_point()
+ facet_grid('drv ~ .')
+ labs(x='displacement', y='horsepower')
)
Then I can add a new category for mpg dataset as:
mpg['drv'] = pd.Categorical(mpg['drv'], ['4', 'f', 'r', 'yingyingying'])
This time the column mpg['drv'] seems like this:

An empty category 'yingyingying' was added.
I add drop=False to my code, but nothing happens:
(
ggplot(mpg, aes(x='displ', y='hwy'))
+ geom_point()
+ facet_grid('drv ~ .', drop=False)
+ labs(x='displacement', y='horsepower')
)

How can I add an empty panel of 'yingyingying' without any data points?
Please tell me if there's any misunderstanding.
Thank you in advance.
Hi, it seems
dropparameter offacet_grid()function do not work.Below is official example:
Then I can add a new category for
mpgdataset as:This time the column
mpg['drv']seems like this:An empty category
'yingyingying'was added.I add
drop=Falseto my code, but nothing happens:( ggplot(mpg, aes(x='displ', y='hwy')) + geom_point() + facet_grid('drv ~ .', drop=False) + labs(x='displacement', y='horsepower') )How can I add an empty panel of
'yingyingying'without any data points?Please tell me if there's any misunderstanding.
Thank you in advance.