[R] Query : Modification of graphs

priti desai priti.desai at kalyptorisk.com
Wed Jul 12 13:26:29 CEST 2006


How to change the background in the plots
The e.g. for which I am working is as follows,
The R script is
###################    start    #######################################

amounts <-
c(21790,5669,34921.17,60152.47,47228.61,16566.13,8283,3980,5445,1000,125
0,0,1285,1222,5001,600,1950,11580,7520,7999,4850,3850,16900,6095,0,4246,
8556,8280,3020,7250,0,8807,0)

# histogram

hist(amounts)

# P-P plot(exponential dist)

Lambda        <- 1/mean(amounts)
N             <- length(amounts) 
e             <- c(1:N)
f             <- c((e-.5)/N)
Fx            <- c(1 - exp(-lambda*amounts))
g             <- sort(Fx)


plot (f, g, main ="P-P Plot",col=6)
abline (rq(g ~ f, tau = .5),col="blue")



# Q-Q plot

e             <- c(1:N)
f             <- c((e-.5)/N)
h             <- c(1-f)
i             <- -log(h,base=exp(1))
F1x           <- c((1/lambda)*i)

j             <- sort(amounts)
z12 <- sort(F1x)

plot (j,F1x,main = "Q-Q Plot",col=6)
abline (rq(F1x ~ j, tau = .5),col="red")

######################     end
#########################################

Please tell me how should I modify my graphs? 
i.e. change the background,  colors,    
how should I modify histogram, P-P plots ,Q-Q plots?

Please suggest me the correct modification, if any calculations &
formula in R.
 Awaiting your positive reply.
 
  Regards
  Priti.



More information about the R-help mailing list