4 Added a link to lattice
source | link

The easiest way is to use R

Use read.csv to enter the data into R, then you canuse a combination of the plot and line commands

If you want something really special, then look at the libraries ggplot2 or latticelattice. 

In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
print(p)   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

Saving plots in R

Saving plots in R is straightforward:

#Look at ?jpeg to other different saving options
jpeg("figure.jpg")
print(p)#for ggplot2 graphics
dev.off()

Instead of jpeg's you can also save as a pdf or postscript file:

#This example uses R base graphics
#Just change to print(p) for ggplot2
pdf("figure.pdf")
plot(d$x,y1, type="l")
lines(d$x, y2)
dev.off()

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
print(p)   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

Saving plots in R

Saving plots in R is straightforward:

#Look at ?jpeg to other different saving options
jpeg("figure.jpg")
print(p)#for ggplot2 graphics
dev.off()

Instead of jpeg's you can also save as a pdf or postscript file:

#This example uses R base graphics
#Just change to print(p) for ggplot2
pdf("figure.pdf")
plot(d$x,y1, type="l")
lines(d$x, y2)
dev.off()

The easiest way is to use R

Use read.csv to enter the data into R, then use a combination of the plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. 

In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
print(p)   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

Saving plots in R

Saving plots in R is straightforward:

#Look at ?jpeg to other different saving options
jpeg("figure.jpg")
print(p)#for ggplot2 graphics
dev.off()

Instead of jpeg's you can also save as a pdf or postscript file:

#This example uses R base graphics
#Just change to print(p) for ggplot2
pdf("figure.pdf")
plot(d$x,y1, type="l")
lines(d$x, y2)
dev.off()
3 added 449 characters in body
source | link

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
print(p)   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

Saving plots in R

Saving plots in R is straightforward:

#Look at ?jpeg to other different saving options
jpeg("figure.jpg")
print(p)#for ggplot2 graphics
dev.off()

Instead of jpeg's you can also save as a pdf or postscript file:

#This example uses R base graphics
#Just change to print(p) for ggplot2
pdf("figure.pdf")
plot(d$x,y1, type="l")
lines(d$x, y2)
dev.off()

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
p   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
print(p)   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

Saving plots in R

Saving plots in R is straightforward:

#Look at ?jpeg to other different saving options
jpeg("figure.jpg")
print(p)#for ggplot2 graphics
dev.off()

Instead of jpeg's you can also save as a pdf or postscript file:

#This example uses R base graphics
#Just change to print(p) for ggplot2
pdf("figure.pdf")
plot(d$x,y1, type="l")
lines(d$x, y2)
dev.off()
2 added 161 characters in body; deleted 10 characters in body
source | link

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
 
#You would use read.csv here
N = 2010
d = data.frame(x=1:N,y=runify1=runif(N),z=rnormy2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, yy1, colour="Type 1"))
p = p+geom_pointp+geom_line(aes(x, zy2, colour="Type 2"))
 
#Optional,p if= youp+geom_line(aes(x, wanty3, yourcolour="Type own3"))
#Add colourspoints
p = p+scale_colour_manualp+geom_point("Type",caes('blue'x,'red' y3, colour="Type 3"))
p   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
 
#You would use read.csv here
N = 20
d = data.frame(x=1:N,y=runif(N),z=rnorm(N))
p = ggplot(d)

p = p+geom_line(aes(x, y, colour="Type 1"))
p = p+geom_point(aes(x, z, colour="Type 2"))
 
#Optional, if you want your own colours
p = p+scale_colour_manual("Type",c('blue','red'))
p

The easiest way is to use R

Use read.csv to enter the data into R, then you can a combination of plot and line commands

If you want something really special, then look at the libraries ggplot2 or lattice. In ggplot2 the following commands should get you started.

require(ggplot2)
#You would use read.csv here
N = 10
d = data.frame(x=1:N,y1=runif(N),y2=rnorm(N), y3 = rnorm(N, 0.5))
p = ggplot(d)

p = p+geom_line(aes(x, y1, colour="Type 1"))
p = p+geom_line(aes(x, y2, colour="Type 2"))
p = p+geom_line(aes(x, y3, colour="Type 3"))
#Add points
p = p+geom_point(aes(x, y3, colour="Type 3"))
p   

This would give you the following plot:

Line plot http://img84.imageshack.us/img84/6393/tmpq.jpg

1
source | link