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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:28:36+00:00 2026-05-30T05:28:36+00:00

I would like to add some information on my graph which was plotted from

  • 0

I would like to add some information on my graph which was plotted from this data set:

EDITTED:

#data set:
day <- c(0:28)
ndied <- c(342,335,240,122,74,64,49,60,51,44,35,48,41,34,38,27,29,23,20,15,20,16,17,17,14,10,4,1,2)
pdied <- c(19.1,18.7,13.4,6.8,4.1,3.6,2.7,3.3,2.8,2.5,2.0,2.7,2.3,1.9,2.1,1.5,1.6,1.3,1.1,0.8,1.1,0.9,0.9,0.9,0.8,0.6,0.2,0.1,0.1)
pmort <- data.frame(day,ndied,pdied)
> pmort
   day ndied pdied
1    0   342  19.1
2    1   335  18.7
3    2   240  13.4
4    3   122   6.8
5    4    74   4.1
6    5    64   3.6
7    6    49   2.7
8    7    60   3.3
9    8    51   2.8
10   9    44   2.5
11  10    35   2.0
12  11    48   2.7
13  12    41   2.3
14  13    34   1.9
15  14    38   2.1
16  15    27   1.5
17  16    29   1.6
18  17    23   1.3
19  18    20   1.1
20  19    15   0.8
21  20    20   1.1
22  21    16   0.9
23  22    17   0.9
24  23    17   0.9
25  24    14   0.8
26  25    10   0.6
27  26     4   0.2
28  27     1   0.1
29  28     2   0.1

I have put together this script and still trying to improve on it so that the rest of the information can be added:

> barplot(pmort$pdied,xlab="Age(days)",ylab="Percent",xlim=c(0,28),ylim=c(0,20),legend="Mortality")

mygraph

I am trying to insert the numbers 0 to 28 (age in days) on the x-axis but could not and I know that it could be a simple script. Secondly, I would like to add the number died or ndied (342 to 2) below each day(0 to 28) along the x-axis.

Example:

   0         1     2     3      4        5  and so on...
(N=342) (N=335) (N=240) (N=122) (N=74) (N=64)

Graph:

Any help would be 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-30T05:28:40+00:00Added an answer on May 30, 2026 at 5:28 am

    I gave you two ways to plot the info: one above the bars and one below. You can tweak it to meet your needs.

    barX <- barplot(pmort$pdied,xlab="Age(days)",
       ylab="Percent", names=pmort$day,
       xlim=c(0,28),ylim=c(0,20),legend="Mortality")
    
    text(cex=.5, x=barX, y=pmort$pdied+par("cxy")[2]/2, pmort$ndied, xpd=TRUE) 
    
    barX <- barplot(pmort$pdied,xlab="Age(days)",
       ylab="Percent", names=pmort$day,
       xlim=c(0,28),ylim=c(0,20),legend="Mortality")
    
    text(cex=.5, x=barX, y=-.5, pmort$ndied, xpd=TRUE)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to add some custom data to an image the user generates
I would like to add some data to the body of a http request
I have a density plot and I would like to add some summary information
I would like to add some additional information to my recently viewed products section
I would like to add some icons to my treeview. Is there a way
I would like to add some paragraphs or new lines or words dynamically but
I would like to add some interactive capability to a python CLI application I've
I would like to add some debugs for my simple ruby functions and I
I would like to add some external .dll libraries e.g. glut32.dll (but it's only
I have two doubts: 1. I would like to add some client side support

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.