I'm working with a Dataframe which has a selection of rows which are within a range of dates. They have a 'day' column which is the numeric day of the month between 1 and 31. The 'day' column is dtype 'category'.
I want to graph these rows sorted by day in a FacetGrid (as shown below), but need to remove the extra empty graphs.
I was thinking of doing so by removing the unused 'day' categories before plotting by using groupby and remove_unused_categories(), however this isn't working (or my implementation is incorrect). I'm currently using the implementation from this previous solution:
drop unused categories using groupby on categorical variable in pandas
dataframe.assign(day=dataframe.day.cat.remove_unused_categories())
graph = sns.FacetGrid(timeframe, col="day")
How can I fix the implementation of remove_unused_categories() or use an alternate solution altogether.
This produces the following image
https://i.stack.imgur.com/0Y8SL.jpg
*Unrelated but 'day' 01 is always out of order in-line. The fix is probably quick but I don't really have the understanding of matplotlib/seaborn to fix it