Special type of stacked plots by ggplot2
<p>I have a data frame that summarizes the number of people living in different household sizes for different age groups in both urban and rural areas. I'd like to visualize the population values in stacked plots so that the length of each section corresponds to the population counts living in that household size for an age group in either rural or urban areas. I have created these two plots so far but neither is what I want. </p>

<p>First effort:
<img src="https://i.stack.imgur.com/RYAak.png" alt="First Effort">  </p>

<p>Second effort:
<img src="https://i.stack.imgur.com/KLQ1a.png" alt="Second Effort"></p>

<p>They are not what I want because they use the same colors for household sizes (s1:s7) in both urban and rural areas. Instead, I want to have 7 shades of green for rural areas and 7 shades of red for urban areas so that these two settings can be easily distinguished in the plot.</p>

<p>Is there any way in ggplot2 to show the values based on two criteria (urban vs. rural, household sizes)? If so, how could it be reflected in the legend?</p>

<p>Thanks so much in advance for your help!</p>