For more information, see: R, Ggplot2, shiny summary
Initial pattern:
Library(GGPLOT2)DT= data. Frame(a = c(2, 7, 4, ten, 1), B = C('b', 'A ', 'C', 'D', 'E'))windowsfonts(MyFont = Windowsfont ("in italics") # # Bound FontP= Ggplot (DT, AES (x =B, y =A, fill =B) + Geom_bar (stat ="Identity", alpha =0.7) + Coord_polar ()P
the rose chart after repair:
Library (ggplot2) dt = data. Frame(A = C (2,7,4,Ten,1), B = C (' B ',' A ',' C ',' D ',' E ')) windowsfonts (MyFont = Windowsfont ("in italics"))# # Bound Fontp = ggplot (DT, AES (x= B,y= A, fill = B) + geom_bar (stat ="Identity", alpha =0.7) + coord_polar () + THEME_BW () + Labs (x="",y="", title ="This rose is a little ugly.") + Geom_text (AES (y= A/2+ MAX (A)/4, label = A, color = B), size =5) +# # Plus numbersTheme (axis. Text. Y= Element_blank ()) +# # Remove the tick labels in the upper left cornerTheme (axis. Ticks= Element_blank ()) +# # Remove the tick marks in the upper left cornerTheme (panel. Border= Element_blank ()) +# # Remove the outer borderTheme (Legend. Position="None") +# # Remove legendTheme (title = Element_text (Vjust =- About, face ="Bold", family ="MyFont"))# # Move the legend below the diagram and change the font formatP
Note: More details of the changes are visible: ggplot2--pie chart, the two similar.
Reprint please indicate the source, thank you! (Original link: http://blog.csdn.net/Bone_ACE/article/details/47624987)
ggplot2--Rose Chart