r - Change the axes on a radial barchart -


i want make radial stacked barchart. have this:

ggplot(diamonds, aes(clarity, fill= cut)) +  geom_bar()  + coord_polar() 

which yields plot this: radial barchart

however crowded. there way change axes barchart hollow? want 0 start not @ center of circle but, say, 1/3 or 1/2 of radius center. ideas that?

you can tell coord_plot expand - puts small hole in middle:

ggplot(diamonds, aes(clarity, fill= cut)) +       geom_bar()  +      coord_polar(expand=true) 

enter image description here

then can control y scale expansion (with argument expand=... scale_y_continuous(...). unfortunately think expansion symmetrical, i.e. if add space @ bottom (i.e. in middle, add @ top (i.e. outside):

ggplot(diamonds, aes(clarity, fill= cut)) +       geom_bar()  +      coord_polar(expand=true) +      scale_y_continuous(expand=c(0.5, 0)) 

enter image description here


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -