how to change the color of each wedges in a pie chart
Title
Question
pie(genrecount, main="properties of movies' genre",
border="blue",
col="orange")
the above code changes the entire color of the pie chart to orange .
my question is,
R Plotting-Histograms-and-Pie-Chart 07-08 min 50-60 sec
Answers:
For this, you need to define a color palette and then pass it to the pie chart, as given below:
--------------------------------------------------------------------------------------------------------------------------
colors = c("red", "yellow", "green", "violet", "orange", "blue", "pink")
pie(genreCount,
main = "Proportion of movies' genre",
border = "blue",
col = colors)
Login to add comment