[R] border of bars in lattice barchart

Deepayan Sarkar deepayan at stat.wisc.edu
Thu May 8 18:38:35 CEST 2003


On Thursday 08 May 2003 11:08 am, Kosenkov Kirill wrote:
> Hello!
>
> How to change a color (or linewidth) of
> border in lattice 'barchart'?
>
> I am trying
>
> barchart(
> 	(......) - my arguments
>             panel=function(x,y,color,subscripts,groups,...)
>             {
> panel.barchart(x=x,y=y,box.ratio=2,col=color,border=FALSE)
>             }))
>
> or
> ...
> panel.barchart(x=x,y=y,box.ratio=2,col=color,border='transparent')
> ...
> or
> panel.barchart(x=x,y=y,box.ratio=2,col=color,border='red')
>
> but it has no effect.
>
> is there any other way to change a barchart border?


Write your own panel function. Start with the default (panel.barchart), and in 
the appropriate grid.rect() calls, change the 

gp = gpar(fill = <...>) 

to 

gp = gpar(fill = <...>, col = <whatever you want>, lwd = <whatever you want>) 

Deepayan




More information about the R-help mailing list