[R] Plotting very skewed data in barplot

Jim Lemon jim at bitwrit.com.au
Tue Jul 3 13:30:39 CEST 2007


Dr. med. Peter Robinson wrote:
> Dear R'ers,
> 
> I would like to use barplot or a similar function to plot data
> demonstrating the distribution of the length of a kind of conservation in
> about 25000 DNA sequences. My data look like this:
> ...
> 
> Therefore, I would like to show the column representing 0 (with 19936
> sequences) "cut" so it doesn't dominate the rest of the plot. Also,
> starting from about 10 sequences, I would like to group the rest of the
> sequences into groups of 5 each (for instance, 10-15, 16-20, 21-25 etc).
> 

  Hi Peter,

Have a look at gap.barplot in the plotrix package. I would suggest 
something like this:

gap.barplot(y,c(500,19800),main="Skewed distribution",
  yaxlab=c(200,400,19900),ytics=c(200,400,19900))

where y is the right column of your data.

Jim



More information about the R-help mailing list