Hi there, I get a strange behaviour of a boxplot with the following code. There seems to be a problem with the xlim-parameter. Did I do anything wrong? What else can I do to force the boxplot to have a defined x-range? x <- rnorm(100) boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal = TRUE) Antje
> I get a strange behaviour of a boxplot with the following code. > There seems to > be a problem with the xlim-parameter. Did I do anything wrong? What > else can I > do to force the boxplot to have a defined x-range? > > x <- rnorm(100) > boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal =TRUE) Did you mean xlim = c(-4,4) in that statement, rather than '<-'? Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
> True, I made a mistake here. Still, I have problems to visualize my data(not> the example code I used). I just see a flat line instead a properplot...> > Another example code with creating a strange plot: > > x <- rnorm(100) + 100 > maxval <- max(x) > boxplot(x, notch=TRUE, xlim = c(0,maxval), horizontal = TRUE)When you use horizontal=TRUE, the meanings of the xlim and ylim arguments to boxplot are swapped. Thus xlim affects the range of the vertical axis. Take a look at boxplot(x, notch=TRUE, ylim = c(0,maxval)) and boxplot(x, notch=TRUE, ylim = c(0,maxval), horizontal = TRUE) Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
Antje <niederlein-rstat <at> yahoo.de> writes:> I get a strange behaviour of a boxplot with the following code. There seems to > be a problem with the xlim-parameter. Did I do anything wrong? What else can I > do to force the boxplot to have a defined x-range? > > x <- rnorm(100) > boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal = TRUE) >This should be just fine if you say boxplot(x, notch=TRUE, xlab=parameter, xlim=c(-4,4), horizontal = TRUE) instead. <- is only for assignment. You must use = for setting arguments to a function. Ben Bolker