I would like to create a mosaic plot with statsmodels.graphics.mosaicplot.mosaic()
with data that casts empty cells. They look ugly in the resulting plot, because a cell is created irrespective of its size.
Example:
import matplotlib.pyplot as plt
import pandas as pd
from statsmodels.graphics.mosaicplot import mosaic
df = pd.DataFrame({'size' : ['small', 'large', 'large'],
'length' : ['long', 'short', 'long']})
print(df) # note that the 'short'-'small' combination is missing
fig = plt.figure()
ax = fig.add_subplot(111)
mosaic(df, ax=ax)
creates a plot with an empty cell for value "short small":
Is there a way to either avoid the creation of this cell or to remove it from the plot afterwards?