Barplot Bar Chart Adjustment __ Bar chart legend

Source: Internet
Author: User

Bar chart for fine tuning


>counts<-table (arthritis$improved)

>barplot (counts,main= "Treatment outcome", horiz=true,cex.names = 1,names.arg = C ("No", "some", "Marked"), Xlim=c ( 0,50), Col=c ("Red", "green", "yellow"), Legend=c ("No", "some", "Marked"), args.legend=c (25,28,X.INTERSP = 0.5,Y.INTERSP = 0.7,text.width=6,cex=1))

Added the legend, and shows how to adjust the length of the axis of the legend, as well as the size and position of the label, the larger the X.INTERSP,Y.INTERSP, the larger the size of its legend, CeX, adjust the size of the entire legend, can be seen as the size of the text inside. Note that both text and the size of the entire legend should be placed in the args.legend adjustment. This example can be seen as the "R Language Combat" p113 page of the improved version.


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.