Skip to main content

All Questions

Tagged with
0 votes
1 answer
1k views

Add values to pie chart legend with ggplot2 in R

I have created a pie chart with ggplot in R plotting "Amounts" for 7 companies (A to G). The data and code are the following: # Data data=data.frame('Company'=(c("A","B",&...
Elsa's user avatar
  • 49
1 vote
3 answers
3k views

Adding legend to pie chart that is wrapped by ggplot

I am quite new with R and require some support with using the pie function. I need to return a ggplot so I have wrapped the pie function with this. The output is a pie chart as expected, only problem ...
user avatar
0 votes
0 answers
54 views

Fix a pie-chart plot to make it more readable by adding a Legend

I need to fix the following pie chart, I need a legend with the names of the countries (percentages can be fine like this. COMP_plot <- comp_plot %>% select(-commodity) %>% ...
Andrea Dalla Rosa's user avatar
3 votes
1 answer
3k views

Arrange 4 plotly pie graphs in R

I have four separate pie graphs all with the same specified color scheme (the code is identical apart from the dataframe). The colors are designated because I want to combine them in the 4 grid ...
user avatar
2 votes
0 answers
69 views

R: Legend position is c(1,0.5), but it is still inside my chart. How can I move it outside without it beeing cut off

I am plotting and saving a pie Chart and want the legend to be closer to the chart than with no position specification. When using This puts the legend inside my pie and when moving the legend even ...
Katsuyo's user avatar
  • 73
0 votes
0 answers
40 views

ggplot pie charts / bar graph, force a legend [duplicate]

I made pie charts embedded in a multiplot as on the picture below. Now I'm struggling to force the same legend on each graph. I would like each legend to be exactly the same for each of the ...
Franky's user avatar
  • 731
0 votes
0 answers
346 views

How to make contrast-colored slices in a pie-chart?

I have a hard time displaying the slices of this pie chart in a clearer manner. The continual shades are difficult to follow. How do I color the slices with contrast colors next to each other? For ...
Little Bee's user avatar
  • 1,215
5 votes
1 answer
9k views

Remove white space (i.e., margins) ggplot2 in R

I'm trying to plot a pie chart using GGPLOT2 in R. I want to do this in such a way as to omit the extra margin space. What I'm doing is similar to what sharoz did in this post here except I want to ...
Chernoff's user avatar
  • 2,572