I wanted to make a graph for my data which looks something like this (This sample image is taken from Google):
But, I am not able to search what is the name of this graph which shows frequencies on the X-axis or what is it called?
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.Sign up to join this community
First of all: it's just a barplot (or barchart) with an additional feature. I personally prefer to put the frequencies inside the bars.
To recreate your data, I use:
mydata <- c(rep("USA", 11), "Russia", "China", "India")
Then to create an R equivalent of your plot:
frequencies <- sort(table(mydata), decreasing = TRUE) bp <- barplot(frequencies # bp contains the central x-coords of the bars , main = "Aircraft Carriers" # title , xlab = "Country" # x-axis label , ylab = "Number") # y-axis label text( x = bp # x-coords of the labels , y = frequencies # y-coords of the labels (change this is you need to) , labels = frequencies # the frequencies are the labels , pos = 1) # put text below the x,y-coordinates