Using Graphs :

> x<- 1:20; y<- x^3
>
> graphsheet()              # [ Opens graphing device]
> plot(x~y)
> plot(x,y)
> hist(x)
> stem(y)

N = 20   Median = 1165.5
Quartiles = 170.5, 3735.5

Decimal point is 3 places to the right of the colon

0 : 000112357
1 : 037
2 : 27
3 : 4
4 : 19
5 : 8
6 : 9
7 :
8 : 0
> graphics.off()                         # [ Closes graphing device]
> dev.list()
NULL
> graphsheet()
> par(mfrow=c(4,2))
> plot(x,y,type="p")
> plot(x,y,type="l")
> plot(x,y,type="b")
> plot(x,y,type="h")
> plot(x,y,type="s")                  #[also try "S"]
> plot(x,y,type="n")
> plot(x,y,type="o")
> plot(x,y,pch="*")
> par(mfrow=c(1,1))
> plot(x~y,pch=116)
> plot(x~y,pch=11)
>plot(x,y, pch="*", main="Graph of \nX and y", sub="Done By Ehsan",
+ xlab="Here we plotted X", ylab="Herewe plotted Y",
+ xlim=c(-5,25), ylim=c(0,7000), type="o", lty=2, axes =T, lwd=2, col=8, box= T)
>plot(x,y,pch="*",main="Graph of \nX and y",sub="Done By Ehsan",xlab="Here we plotted X",
+ ylab="Here we plotted Y",xlim=c(-5,25),ylim=c(0,7000),type="o",lty=1,axes =F, lwd=3, col=8, box= F)
> arrows(5,1000,15,2000,col=3)# [What happens in GSD# ?]
> arrows(5,1500,15,2500,col=4)
> box()
> axis(2)
> axes()
> points(5,4000, pch ="#",col=3)
> text(5,3000, "i am here : can you see me ?",col= 7)
> abline(v=c(6,1,9))
> abline(h=c(1000,2000,3000))
>abline(4,2000)
> plot(10:1,c(1:4,NA,6:10),type="b",col=3)
> text(5,5,"Value Not Available here \nso this place remains empty",col=7)

Back to Index page