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 7999175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:25:41+00:00 2026-06-04T15:25:41+00:00

I want to plot two graphs on one plot. I read this post ,

  • 0

I want to plot two graphs on one plot. I read this post, but function lines does not work, nothing happens. I don’t know what can be the problem. Any ideas?

Edit. reproducible example:

> tr_error
[1] 0.2314984 0.2314990 0.2314981 0.2314955 0.2314955 0.2314943 0.2314912
[8] 0.2314924
> tst_error
[1] 0.001461264 0.001461767 0.001461001 0.001459936 0.001459626 0.001458594
[7] 0.001457719 0.001458288
> plot(tst_error, type='l')
> lines(tr_error, type='l', col='red')

maybe there is second plot but it is higher?

  • 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-06-04T15:25:42+00:00Added an answer on June 4, 2026 at 3:25 pm

    It “doesn’t work” because the y-limits do not include the range of the second vector.

     plot(tst_error, type='l', ylim=range( c(tst_error, tr_error) ) )
     lines(tr_error, type='l', col='red')
    

    It’s not going to be a particularly interesting plot since the scale of the two vectors are so different. The red line’s going to look like a completely flat line.

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

Sidebar

Related Questions

With this approach. I have a line plot graph. I want to plot 'two'
I want to combine two ggplots, from two different data.frames, into one plot. Below
I want to plot a series of lines with one half-space filled for each
I've got a scalar function of two variables that I want to plot. Using
I have a data which I want to plot in cumulative function. The R
I have created a scatter graph with three plot spaces. One for two y-axis
How does one plot the solutions to a set of equations in Mathematica? Even
Whenever, I want to plot multiple 2d line graphs graphs with matplotlib, I define
I want to draw path from one location to other location. How to plot
Query 1: I'm using MKMapKit in which I want to display two location one

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.