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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:55:27+00:00 2026-06-09T13:55:27+00:00

How to scatter plot the following: var1 var2 1 10 2 2 20 4

  • 0

How to scatter plot the following:

  var1  var2
1  10  2
2  20  4
3  30  8
4  40  16
5  80  32

I need to color var1 and var2 with difft colors. x-axis should range from 1 to 5. How can I add a line showing trend of the data?

  • 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-09T13:55:29+00:00Added an answer on June 9, 2026 at 1:55 pm

    Your question is not very clear, but assuming your data is in df, it sounds like you want something like this to get started:

    plot(1:5, df$var1, pch=19, col="blue", ylim=c(0,80))
    points(1:5, df$var2, pch=19, col="red")
    

    As for the trend of the data, what do you mean? A trend for each line? Or do you actually want to plot var1 against var2 (I have assumed you don’t want that otherwise there would be no point having two colours).

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

Sidebar

Related Questions

In the following minimal example, I create 1-point scatter plot and later change color
How should I best approach drawing a scatter plot diagram in Cocoa?
Related to this question , I want a 3D scatter plot with prescribed colors
I made a scatter plot, and want to add a link to each dot.
Scatter Plots in MatLab. I can create a scatter plot with x and y
How to change area gradient color for negative values in Gradient Scatter Plot in
In Python, with Matplotlib, how can a scatter plot with empty circles be plotted?
I want to create a 3d scatter plot of spheres with their color being
I need to draw a scatter plot with the given array of numbers in
I need to write an application in VB6 which makes a scatter plot out

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.