[R] Query : Modification of graphs

Petr Pikal petr.pikal at precheza.cz
Thu Jul 13 08:18:41 CEST 2006


Hi

On 12 Jul 2006 at 16:56, priti desai wrote:

Date sent:      	Wed, 12 Jul 2006 16:56:29 +0530
From:           	"priti desai" <priti.desai at kalyptorisk.com>
To:             	<r-help at stat.math.ethz.ch>
Subject:        	[R] Query : Modification of graphs

> 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,1
> 25
> 0,0,1285,1222,5001,600,1950,11580,7520,7999,4850,3850,16900,6095,0,424
> 6, 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?

Did you read help pages about plot and hist?

see parameter col = and look also to par help page and bg parameter.

BTW when you will look at these you could try also look at qqplot.

HTH
Petr

> 
> Please suggest me the correct modification, if any calculations &
> formula in R.
>  Awaiting your positive reply.
> 
>   Regards
>   Priti.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list