Saturday 13 April 2019

Bar Plot


h=c(7,12,28,3,41)                 
m=c("mar","apr","may","jun","jul")
barplot(h,names.arg=m,xlab="month",ylab="revenue",col="blue",main="revenue chart",border="red")

___________________________________________________
colors=c("green","orange","brown")   
months=c("mar","apr","may","jun","jul")
regions=c("east","west","north")

values=matrix(c(2,4,5,3,5,2,5,3,7,8,9,4,7),nrow=3,ncol=5,byrow=TRUE)
barplot(values,names.arg=m,xlab="month",ylab="revenue",col=colors,main="revenue chart",border="red")
legend("topleft",regions,cex=1.3,fill=colors)

No comments:

Post a Comment