An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090425/6b3d746d/attachment-0001.pl>
How to custom the tick and type in bwplot
3 messages · Guanghong Zuo, David Winsemius, Deepayan Sarkar
On Apr 24, 2009, at 1:33 PM, Guanghong Zuo wrote:
Dear R users I use bwplot to plot some figures. There are two troubles: 1. How to change the dot of the mean to a line, like the style in boxplot
Sometimes you need to refer the the help page for panel.<type of plot>, in this case: ?panel.bwplot ... so the answer is now staring you in the face: bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos, pch="|")
2. How to hide some tick marks. For example, I have seven tick: A, B, C, D, E, F, G, but I want show four marks: A, C, E, G on the x-axis.
Using the example in bwplot again, and a fair amount of fruitless
experimentation with the theory that one could do anything useful with
scales=list(at= list(<something>)), I finally ended up trying ,
labels=c( ) per Sarkar's Lattice book, producing this:
bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos,
scales=list(x=list( labels=c("A","","","D","","F","","") )))
David Winsemius, MD Heritage Laboratories West Hartford, CT
On 4/24/09, David Winsemius <dwinsemius at comcast.net> wrote:
On Apr 24, 2009, at 1:33 PM, Guanghong Zuo wrote:
Dear R users I use bwplot to plot some figures. There are two troubles: 1. How to change the dot of the mean to a line, like the style in boxplot
Sometimes you need to refer the the help page for panel.<type of plot>, in this case: ?panel.bwplot ... so the answer is now staring you in the face: bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos, pch="|")
2. How to hide some tick marks. For example, I have seven tick: A, B, C,
D,
E, F, G, but I want show four marks: A, C, E, G on the x-axis.
Using the example in bwplot again, and a fair amount of fruitless
experimentation with the theory that one could do anything useful with
scales=list(at= list(<something>)), I finally ended up trying , labels=c( )
per Sarkar's Lattice book, producing this:
bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos,
scales=list(x=list( labels=c("A","","","D","","F","","")
)))
or
bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos, pch="|",
scales = list(x = list(at = c(1, 3, 5, 7), labels = c("A", "C",
"E", "G"))))
or
bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos, pch="|",
xlim = c("A", "", "C", "", "E", "", "G"))
-Deepayan