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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:46:28+00:00 2026-05-28T07:46:28+00:00

Happy new year to you all! I am plotting some graphs and would like

  • 0

Happy new year to you all!

I am plotting some graphs and would like to differentiate some plotted lines and points. This is an example of my data and the graph that I am trying to get:

anim <- c(1,2,3,4,5)
var1 <- c(32,36,40,38,39)
var2 <- c(30,31,34,36,38)
surv <- c(0,1,0,1,1)
mydf <- data.frame(anim,var1,var2,surv)
mydf
  anim var1 var2 surv
1    1   32   30    0
2    2   36   31    1
3    3   40   34    0
4    4   38   36    1
5    5   39   38    1

lm.pos1 <- lm(var1~var2,data=mydf)
plot(mydf$var2,mydf$var1,xlab="ave.ear",ylab="rtemp",xlim=c(25,45),ylim=c(25,45))
abline(lm.pos1)
abline(h=37.6,v=0,col="gray10",lty=20)
abline(h=34,v=0,col="gray10",lty=20)

First, I would like to insert the label “37.6°C” on the top horizontal and continuous line and “34.0°C” on the bottom horizontal and broken line.

Second, I would like to colour those individuals (circles) as red if surv=0 (died) or green if surv=1.

Any help would be very much appreciated!

Baz

  • 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-28T07:46:29+00:00Added an answer on May 28, 2026 at 7:46 am
    plot(mydf$var2, mydf$var1, xlab="ave.ear", ylab="rtemp", 
        xlim=c(25,45), ylim=c(25,45), col=c('green', 'red')[surv+1])
    abline(lm.pos1)
    abline(h=37.6,v=0,col="gray10",lty=20)
    text(25,38.1,parse(text='37.6*degree'),col='gray10')
    abline(h=34,v=0,col="gray10",lty=20)
    text(25,34.5,parse(text='34*degree'),col='gray10')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all happy new year etc. I am having trouble with templating some function
First of all, Happy New Year to anybody out there reading this! I have
Happy New Year. I have a bunch of SOAP Web Services. They all have
Hi there (& Happy New Year!) Are there some examples on how I can
first of all an Happy New Year to all :) I have found that
First of all-many season-greetings and a happy new year to all of you! Have
Happy New Year Everyone! I have this existing php code I did when I
hope you all had a happy new year. So, my question is, what's the
Hello and Happy New Year all! While thinking about new project I decided to
Happy New Year 2010 everyone :) Just getting back into the Flash groove, and

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.