saving . . . saved how to change the color of each wedges in a pie chart has been deleted. how to change the color of each wedges in a pie chart has been hidden .
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,

how to change the color of each wedges in a pie chart ?


R Plotting-Histograms-and-Pie-Chart 07-08 min 50-60 sec 05-05-20, 8:49 p.m. suhailalphacs

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)
05-05-20, 9:49 p.m. sudhakarst
thank you so much !!!! i got the o/p
05-05-20, 10:12 p.m. suhailalphacs

Login to add comment


Log-in to answer to this question.