Pandas stacked bar plotting with different shapes

I'm currently experimenting with pandas and matplotlib. I have created a Pandas dataframe which stores cards from a trading card game (Magic The Gathering). Each card has a specific coloridentity, stored in a column (for example green, red, etc). To play cards you have to pay their costs in the game which can be simply said from 0 to X (called cmc and also stored in a column). What I now want to do is to make a stacked bar plot where I can see how many entries per each cost exist. And I want to do that for all colors and stack them above.

My thoughts so far:

#get all unique values of colors
unique_values = df['coloridentity'].unique()

#Create two dictionaries. One for the number of entries per cost and one 
# to store the different costs for each color
color_dict_values = {}
color_dict_index = {}
for u in unique_values:
    temp_df = df['cmc'].loc[df['coloridentity'] == u].value_counts()
    color_dict_values[u] = np.array(temp_df)
    color_dict_index[u] = temp_df.index.to_numpy()

width = 0.4
p1 = plt.bar(color_dict_index['G'], color_dict_values['G'], width, color='g')
p2 = plt.bar(color_dict_index['R'], color_dict_values['R'], width, 
             bottom=color_dict_values['G'], color='r')
plt.show()

So but this gives me an error because the line where I say that the bottom of the second plot shall be the values of different plot have different numpy shapes.

enter image description here

Does anyone know a solution? I thought of adding 0 values and also filling up the index somehow, but I don't know if this is the best solution, and if yes how the best way would be to solve it.