ggplot2--Rose Chart

Source: Internet
Author: User
Tags ggplot

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.