1

Is there a way to combine stacked bar plot and stacked area plot in ggplot2 (or in any other graphics package in R)? I'd like to create a stacked bar plot with some space between the columns. The groups of the bars should than be connected by the areas. In other words, instead of edges of an area plot, there should be bars with percentage labels for the groups.

What I've tried is:

ggplot(subdata, aes(x=variable, y=value, group=Name, fill=Name)) +
geom_area (positon="fill") +
geom_bar(stat="identity", colour="black")

The problem is that I'd like the filled areas to connect the boundaries of the bars rather than their midlines. Is there a way to accomplish this?

1

1 Answer 1

1

I asked this question on the ggplot2 mailing list after not getting any answers here, and Winston Chang came up with a solution: Thread within ggplot2 google group

Sign up to request clarification or add additional context in comments.

2 Comments

You should consider recognizing this as an complete answer and close this thread.
Could you reproduce the answer here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.