Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 911823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:16:31+00:00 2026-05-15T17:16:31+00:00

I need to plot a graph where the X values are all names -e.g.

  • 0

I need to plot a graph where the X values are all names -e.g. states of America

and the Y values are numberic and in descending order- e.g. population of the states of America.

Currently, when I use the plot function, it plots a graph but a) The Y values are not in descending order and b) the X Axis displays a bunch of ascending numbers, not the names of the states.

Thanks for the help.

EDIT:

I was using R’s data sets: state.name and state.area

>state.name

[1]"Alabama" etc

>state.area

[1] 51609 etc

my actual data is very similar so I was just playing around with those.

Trial.Group   Mean Heart Rate      Upper Confidence Interval    Lower Confidence Interval
33subj-Male   80                    120                          70
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:16:32+00:00Added an answer on May 15, 2026 at 5:16 pm

    Sounds like you want a barchart (or maybe a dotplot). There are 3 different plotting systems in R; here are solutions in order of preference.

    #Some US state data
    data(state)
    dfr <- data.frame(name = state.name, area = state.area)
    dfr$name <- with(dfr, factor(name, levels = name[order(area)]))
    
    #The ggplot way
    library(ggplot2)
    ggplot(dfr, aes(name, area)) + geom_bar() + coord_flip()
    
    #The lattice way
    library(lattice)
    barchart(name ~ area, data = dfr)
    
    #The base way
    par(las = 1, mar = c(4, 7, 1, 1))
    with(dfr, barplot(area, names.arg = name, horiz = TRUE))
    

    EDIT:
    I made the bars horizontal in order to make it easier to read the labels.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having data as like below. I need to plot graph based on region.
I need to read some data from an input file and plot a graph
I need to import a plot graph from matlab into java swing GUI? Is
I need to plot multi curves in a single graph in R, for example
I want to plot the pitch of a sound into a graph. Currently I
I am using core-plot but i need to use any other api? please help
Ive been having some trouble using Plot to graph a complicated composite function. I
I need to plot two data vectors with errorbars on one figure. errorbar() function
Hi I have a need to create a Ternary Plot graph from 3 different
I have a problem in Python with Unicode. I need plot a graph with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.