I have two series with different lengths and amount of variables and want to plot how often each variable (Name) occurs per series. I want a grey countplot for series 1 and a red countplot for series 2, and I want them to be shown on top of each other. However, since series 2 is missing 'Nancy' it is also cutting series 1 count of 'Nancy'. How do i get a full overlay of the two series inkluding a bar for Nancy?
import matplotlib.pyplot as plt
import seaborn as sns
ser1 = pd.Series( ['tom','tom','bob','bob','nancy'])
ser2 = pd.Series( ['tom','bob'])
fig = plt.figure()
sns.countplot(x=ser1, color='grey')
sns.countplot(x=ser2, color='red')
plt.show()
Edit: Changing to the following will cause problems again. How do I make Matplotlib recognize that the two series have the same categorical values that are being counted?
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
ser1 = pd.Series( ['tom','tom','bob','bob','nancy','zulu'])
ser2 = pd.Series( ['tom','nancy'])
ser1 = ser1.astype('category')
ser2 = ser2.astype('category')
fig = plt.figure()
ax = sns.countplot(x=ser2, color='red', zorder=2)
sns.countplot(x=ser1, color='grey')
plt.show()

