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

  • SEARCH
  • Home
  • 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 7686853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:34:26+00:00 2026-05-31T19:34:26+00:00

With this approach. I have a line plot graph. I want to plot ‘two’

  • 0

With this approach. I have a line plot graph. I want to plot ‘two’ line plot on the same graph. How can I simply add that data,

The data is in the form

1  5  10
2  8  20
3  9  30

I want to plot the X as column1 and the other two columns along the y axis.

-----
 # Commands
  2
  3 library(ggplot2)
  4
  5 req <- read.table("stats_quick_sort.dat")
  6
  7 summary(req)
  8
  9 xx <- req$V1
 10 yy <- req$V2
 11
 12
 13 png('stats_sort_image.png', width=800, height=600)
 14 gg <- qplot(xx, yy) + geom_line()
 15 print(gg)
 16 dev.off()
  • 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-31T19:34:27+00:00Added an answer on May 31, 2026 at 7:34 pm

    As an aside — if you provide a reproducible example that demonstrates your problem, it is much easier for us to help you. I’m going to give you a reproducible example as an answer so you see what I mean. It means anyone can copy and paste the code and it’ll work (whereas I couldn’t copy/paste your code because I don’t have stats_quick_sort.dat).

    To plot multiple lines on a plot you just call geom_line again, feeding in the x and y variables to aes:

    # generate some dummy data so this example can be reproduced
    xx  <- sort(runif(20))
    yy  <- runif(20)
    yy2 <- runif(20)
    
    gg <- qplot(xx, yy) + geom_line()        # first line
    gg <- gg + geom_line(aes( x=xx, y=yy2 )) # add the second line!
    print(gg)
    

    In general, if you want to add other information to your plot that you did not supply in the initial qplot/ggplot call, then just feed it in to aes. You want a line? Use geom_line. You want new x and y coordinates? Then use geom_line(aes(x= .., y=..)). And so on.

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

Sidebar

Related Questions

I am wondering how you would approach this problem I have two Taxrates that
I currently have this line of code which I want to work in all
I have this small testcase: http://jsfiddle.net/sV8js/ You can see that in Chrome (tested on
I have tried this approach/hack: http://blog.blackwhale.at/2009/06/uibuttons-in-uinavigationbar/ The problem is this leaves a faint seam.
I have a question, is this the correct approach to make a Generic Singleton?
I have only recently started working with the MVC approach, so I suppose this
Can I use this approach efficiently? using(SqlCommand cmd = new SqlCommand(GetSomething, new SqlConnection(Config.ConnectionString)) {
Let me start by saying that I do not advocate this approach, but I
I don't want to discuss the merits of this approach, just if it is
I have a JLabel that needs to display some html-formatted text. However, I want

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.