File:GewichtLebenstag.svg
Summary
| Description |
Deutsch: Gewicht eines Babys in Abhängigkeit vom Lebenstag / Bsp.graph GNU R |
| Date | |
| Source | Own work |
| Author | Karsten Adam |
Quellcode
The plot was created with the following R-program:
library(ggplot2) # this allows the plot magic
# data retrieval
x <- c(1, 3, 6, 11, 12, 15, 19, 23, 28, 33, 35, 39, 47, 60, 66, 73)
y <- c(3180, 2960, 3220, 3270, 3350, 3410, 3700, 3830, 4090, 4310, 4360, 4520,
4650, 5310, 5490, 5540)
dayweight <- data.frame(x,y)
colnames(dayweight) <- c("Lebenstag", "Gewicht")
rm(x,y)
# do the plot
ggplot(dayweight, aes(x = Lebenstag, y = Gewicht)) +
geom_point(colour="blue", size = 2.5) + # Data as points
geom_line(colour="blue", size = 0.8) + # line to connect points
# line model, no confidence intervall (level=0)
geom_smooth(method = "lm", colour = "black", level = 0) +
ggtitle("Gewicht des Babys") + # plot titel
ylab("Gewicht in Gramm") + # label of y-axis
# x-axis dividing all the 10 instead of all the 20 days
scale_x_continuous(breaks = seq(0,70,by=10)) +
# y-axis dividing all the 500 instead of all the 1000 gramms
scale_y_continuous(breaks = seq(3000,5500,by=500))
Licensing
I, the copyright holder of this work, hereby publish it under the following licenses:
| Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. |
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
You may select the license of your choice.