= Diet_B )) +
geom_boxplot() +
xlab(Migration) + ylab(Distance)
p
John Kane
Kingston ON Canada
-Original Message-
From: r...@temple.edu
Sent: Mon, 24 Sep 2012 19:00:09 -0400
To: elaine.kuo...@gmail.com
Subject: Re: [R] boxplot of different colors
## I would do
hello Richard,
Thank a lot.
The plot is breathtaking.
I would like to make three modifications.
Please kindly help and thanks.
1. making outliers from dash to empty circle (pch=2)
I tried plot.symbol as the code below but failed.
2. making font size of axis (levels) larger to 1.2
unsure where
Hello,
I am making a boxplot of 13 boxes.
I tried to color the box using 13 colors but failed.
Only red and brown were displayed.
Green, blue, and grey disappeared.
Please kindly advise modification after checking the code below.
Thank you in advance.
Elaine
R code
# data input
dataN
Hi Elaine,
Without a reproducible example it's impossible to say, but I'd take a
hard look at:
table(obs.group)
If that doesn't give you some insight, a small reproducible example
included in your email using dput() would allow us to answer you more
effectively.
Sarah
On Mon, Sep 24, 2012 at
## I would do this in lattice using the panel.bwplot.intermediate.hh
## function from the HH package.
## install.packages(HH) ## if necessary
library(HH)
dataN - data.frame(GE_distance=rnorm(260),
Diet_B=factor(rep(1:13, each=20)))
Diet.colors - c(forestgreen,
Hello Richard,
Your answer is a great help to my problem.
The boxplot of 13 colors is very beautiful :)
By the way, I have three subsequent questions of your code
1. the meaning of pch=rep(|,13)
I read the R manual but could not interpret the part.
pch means the point type in plot, but here
Hello Sarah,
Thanks for the suggestion of
table(obs.group).
I checked it and found no problems of the obs.group.
As for using dput(),
please kindly share some examples to display the colored graph in r-help.
In fact, some colors were assigned to all types of diets, like
A=red1
B=red2
C=green1
See ?panel.bwplot for pch=|.
That explains that pch=| puts horizontal lines instead of dots at the
median(and also at the
outliers).
The rep makes it into a vector to be indexed by panel.bwplot.intermediate.hh
in each of its calls to panel.bwplot
The names under each plot are the levels of the
8 matches
Mail list logo