Skip to content

method or package to make special boxplot

5 messages · Zhang Qintao, John Kane, David Winsemius +2 more

#
Please supply some sample data and preferably the code that you have used so far.  

To supply data the best way is probably to use the dput() function.  If your data is 'mydata' simply do : dput(mydata) and paste the results into your email


John Kane
Kingston ON Canada
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
#
On Sep 8, 2012, at 7:14 AM, Zhang Qintao wrote:

            
Boxplots do _not_ have continuous "X" axes. You will need to explain in greater detail what goal you are seeking. Perhaps something like a bagplot?

http://gallery.r-enthusiasts.com/RGraphGallery.php?graph=112

--
David Winsemius, MD
Alameda, CA, USA
#
The symbols function allows you to place boxplot symbols at specified
x,y coordinates.  Would that do what you want?
On Sat, Sep 8, 2012 at 8:14 AM, Zhang Qintao <qintao.zhang at gmail.com> wrote:

  
    
#
On 09/09/2012 12:14 AM, Zhang Qintao wrote:
Hi Qintao,
Do you want a sort of 2D boxplot? The example below gives a rough idea 
as to what it would look like, with boxplots for your Xs and Ys centered 
at their medians and an abcissa with the labels for your splits. Needs a 
bit of work to turn this into a function, so let me know if it does what 
you want.

Jim

x1<-rnorm(10)
y1<-rnorm(10)
y2<-rnorm(10)
x2<-rnorm(10)
x1sum<-boxplot(x1)
y1sum<-boxplot(y1)
offset=4
x2sum<-boxplot(x2,at=median(y2)+offset,add=TRUE)
y2sum<-boxplot(y2+offset)
bxp(x1sum,at=median(y1),xlim=c(y1sum$stats[1],y2sum$stats[5]),
  ylim=c(min(c(x1sum$stats[1],x2sum$stats[1])),
  max(c(x1sum$stats[5],x2sum$stats[5]))),axes=FALSE)
bxp(y1sum,at=median(x1),add=TRUE,horizontal=TRUE,axes=FALSE)
bxp(x2sum,at=median(y2+offset),add=TRUE,axes=FALSE)
bxp(y2sum,at=median(x2),horizontal=TRUE,add=TRUE,axes=FALSE)
box()
axis(2)
axis(1,at=c(median(y1),median(y2)+offset),labels=c("Split1","Split2"))