Skip to main content

All Questions

Tagged with
4 votes
2 answers
1k views

Stacked barplot with different colors for each bar in base R

I am trying to create a figure with subplots with stacked barplots. I would like each bar to have a different color gradually changing across categories in the x-axis. I also want the stacked part of ...
owl's user avatar
  • 1,951
1 vote
1 answer
2k views

How to add multiple legend titles (columns) in ggplot

In the stacked bar chart, I have different colors for treatment group and control group. Green for control group and blue for treatment group. In the legend part, I want to show two columns of legends,...
Hannah Xin Yuan's user avatar
0 votes
1 answer
3k views

ggplot2: Missing legend when specify color using fill in geom_bar

In the stacked bar chart, I am trying to specify the color for different bars. E.g, gradient green for treatment group and gradient blue for control group. However, after specifying the colors, I lost ...
Hannah Xin Yuan's user avatar
1 vote
4 answers
16k views

How can I have different color for each bar of stack barplots? in R

My question maybe very simple but I couldn't find the answer! I have a matrix with 12 entries and I made a stack barplot with barplot function in R. With this code: mydata <- matrix(nrow=2,...
user3576287's user avatar
  • 1,002