Using Pandas, python 3. Working in jupyter.

Ive made this graph below using the following code:

```
temp3 = pd.crosstab(df['Credit_History'], df['Loan_Status']) 
temp3.plot(kind = 'bar', stacked = True, color = ['red', 'blue'], grid = False)
print(temp3)

```

[![Stacked Bars](https://i.stack.imgur.com/Op0Bz.png)](https://i.stack.imgur.com/Op0Bz.png)

And then tried to do the same, but with divisions for Gender. I wanted to make this:
[![Four Bars](https://i.stack.imgur.com/WwEIG.png)](https://i.stack.imgur.com/WwEIG.png)

So I wrote this code:
[![enter image description here](https://i.stack.imgur.com/eA3Yw.png)](https://i.stack.imgur.com/eA3Yw.png)

And made this monstrosity. I'm unfamiliar with pivot tables in pandas, and after reading documentation, am still confused. I'm assuming that `aggfunc` affects the values given, but not the indices. How can I separate the loan status so that it reads as different colors for 'Y' and 'N'?

Trying a method similar to the methods used for `temp3` simply yields a key error:

```
temp3x = pd.crosstab(df['Credit_History'], df['Loan_Status', 'Gender']) 
temp3x.plot(kind = 'bar', stacked = True, color = ['red', 'blue'], grid = False)
print(temp3)

```

How can I make the 'Y' and 'N' appear separately as they are in the first graph, but for all 4 bars instead of using just 2 bars?