Skip to main content

Posts

Showing posts with the label barplots

Ggplot2 package (part2)

In the previous post  ggplot2 package (Part1)  ( https://dataworldblog.blogspot.com.es/2017/07/ggplot2-package-part1.html ) we cover some plots using  ggplot2 , here we will cover Barplots along with how to plot different plots together. Barplot : library ( ggplot2 ) ## Warning: package 'ggplot2' was built under R version 3.4.1 # Barplot one ggplot ( chickwts , aes ( x = feed ) ) + geom_bar ( ) + xlab ( "Feed" ) + ylab ( "Count" ) + ggtitle ( "Chickwts1" ) one two ggplot ( chickwts , aes ( x = feed ) ) + geom_bar ( color = "red" , fill = "pink" , width = 0.5 ) + xlab ( "Feed" ) + ylab ( "Count" ) ggtitle ( "Chickwts2" ) two Grid Lines three ggplot ( chickwts , aes ( x = feed ) ) + geom_bar ( fill = 'steelblue' , width = 0.3 ) + coord_flip ( ) + xlab ( "Feed" ) + ylab ( "Count" ) + theme ( pane...