I wanted to make a graph for my data which looks something like this (This sample image is taken from Google):

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?

  • 2
    $\begingroup$ The x axis shows category labels. The counts (or frequencies) are shown on the y axis. In general, by googling "statistical graphics gallery" you can find examples of many graphics with common names. $\endgroup$
    – whuber
    Jul 18 '18 at 16:47

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

To produce:

Aircraft carriers per country.


It is a column chart with data table.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.