Hello,

I try to handle a simple bar-plot, but it turns out to be not as simple
as I thought.

1) I have created a .dat-File, e.g. test.dat:

DATA    DATA-SEM
2.2     0.32 
6.2     1.30
12.7    1.61
48.6    3.08
4.1     0.86
4.5     0.32
1.5     1.13
1.2     1.08

The first row is the data represented by bars. The second row deals with
the Standard Error of Mean. The lines correspond to time-intervals of
experiments. 

2) I now wrote this R-Script:
#=====BEGIN=====
# example.R

library(gdata)
library(gtools)
library(gmodels)
library(gplots)
library(plotrix)

data <- matrix(scan("./plot/example.dat", skip=1), ncol=2, nrow=8,
byrow=TRUE, 
dimnames=list(c("1", "2", "3", "4", "5", "6", "7", "8"),c("DATA",
"DATA-SEM")))

conf_l <- data[, 1]                     
conf_u <- data[, 1] + data[, 2] 

op <- par(no.readonly = TRUE)           

par(lab=c(8,10,7))

barplot2(
height=data[, 1],               
width=1,                        
space=1,                        
col='black',
border='black',
angle=0,                        
density=NULL,           
ylim=c(-2,55),                  
xpd=FALSE,                      
axes=TRUE,                      
las=1,
ci.u=conf_u,                    
ci.l=conf_l,
plot.ci=TRUE,
ci.color="black",
ci.lty="solid",
ci.lwd=1,
horiz=FALSE,
main="Header",
ylab="",
xlab="\nduration of treatment",
plot.grid=TRUE)

par(op)

#====END=====

As you can see, because of the 4th bar (value > 45), the other bars look
a little bit tiny: there is too much white-space. What I need to handle
this problem is a function to insert a gap.

I tried to use gap.barplot, but unfortunately, it cannot handle any of
the parameters I need from the barplot2-function.

After days of missing effort, I am sick of this problem. Is there a
solution?

Thanks for your help,

Marc

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to