0

Help me with the R code to complete the following, preferably using ggplot2. But open to other packages.

I have a table with percentages that total to 1.

For example:
Group 1 answered, a for 25%, b for 15%, c for 10% and d for 50%.

I'm visualizing this into a stacked bar chart but I'd like the outline to be a person.

I've seen this question that starts answering the problem but cannot work out how to change the code for my purpose:

I want one person filled with the different percentages, like this:

Click here for an example output i'm looking for. Originally found in a google search.

Daniele Santi
  • 771
  • 3
  • 24
  • 31
  • 1
    Seems like the first thing you need is an image to fill. The question you link is marked as a duplicate [of this question](https://stackoverflow.com/a/46594692/903061). The first step of the answer [is finding and downloading the image to fill, like this one](https://imgur.com/a/EoM1f). Do you have the image like that? Then have you run the image code from the answer? Where did you get stuck? Do you have sample data? Can you share it in nice copy/pasteable R syntax? – Gregor Thomas Apr 15 '19 at 15:46
  • 2
    With neither code nor data, this question is too broad for SO, but I'd also caution you on the data visualization choice. This chart is stacked as though these percentages add up to an entire group, but if taken as presented, it's 243% of the group. You said your data adds to 100%, but still be careful building off of poorly done visualization. It also encodes values to their height of the person, but because the person isn't of a uniform width, the area of each slice differs and distorts the representation. – camille Apr 15 '19 at 16:56

0 Answers0