Skip to content

Barplot Labels Problem

6 messages · Rodrigo Aluizio, Fernando Marmolejo Ramos, Ben Bolker +2 more

#
Dear R team

Jim Lemon recently said regarding new improvements in PrettyR and plotrix:
?Remember, it is your whingeing and moaning that have helped to make these
packages what they are today.?

So, this is my whinge: out there is a freeware called Vista, which runs, among
other things, bootstrap analyses. Most of the numerical reports given by Vista
can be done using packages such as ?boot?, ?bootstrap?, and ?simpleboot?. I?ve
not explored all the functions in these packages thoroughly (very casually), but
the first thing I noticed is that the graphical output is majorly histograms.
Vista offers a so-called Multiple Visualisation (MV) of the output of a
bootstrap (it shows on the same window scatter plots for a particular variable
showing the bootstrapped CI, a scatter plot of the evolution of the bootstrapped
mean over many sample sizes, a box plot, a QQ plot, and a histogram).

I wonder if there is any manner in which this sort of MV could me mimicked by R
in the case of bootstrap. My best guess is that I?d have to create a 3 by 2
frame an insert each graph separately or maybe resort to Trellis graphics
 am I
right? Does anyone have a more sophisticated solution?

Cheers,

Fer
#
Fernando Marmolejo Ramos <fernando.marmolejoramos <at> adelaide.edu.au> writes:
am I
I'm not sure this is the right kind of problem for Trellis graphics
(which are geared toward using the same plot type for different
subsets of the data in each panel, rather than different plot types
of the same data).  The "unsophisticated" solution (which seems
just fine), as you suggest, is to use par(mfrow) or par(mfcol)
to break up the plot window into frames, and then plot the
different bits in each window.

See http://emdbolker.wikidot.com/blog:dynamite for an example
of plotting the same data in different ways within subplots
(and 
http://emdbolker.wdfiles.com/local--files/blog:dynamite/barboxdotviolin.R
for the code).

 As far as R is concerned, "sophisticated" would mean
creating a plotting function for this so that you never
had to look at the details again ...

  Ben Bolker
#
Or if you want the plots to not all be the same size and line up in various ways (boxplots as margins of scatter plot, etc.) then look at the layout function.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
am I
#
Rodrigo Aluizio wrote:
Hi Rodrigo,
I think that the staxlab function in the plotrix package might do what 
you want.

For the legend problem, I would suggest not using the barplot legend 
option but using the legend function with bty="n".

Jim
1 day later
#
Thanks for the help Jim,
The legend function solved the legend border problem but the labels, even 
using staxlab from plotrix are still being cut by the device limits, like 
there is some kind of character number limits or something like that.
Anyway thank you so much, I'll keep trying and searching.

Rodrigo.

--------------------------------------------------
From: "Jim Lemon" <jim em bitwrit.com.au>
Sent: Saturday, October 25, 2008 9:16 AM
To: "Rodrigo Aluizio" <r.aluizio em gmail.com>
Cc: "R Help" <r-help em r-project.org>
Subject: Re: [R] Barplot Labels Problem