# Move Boxplots on x axis

#### tolbus

##### New Member
Hello everyone!

I've searched for several days but didn't find any working answer.
I want to make a boxplot with two different dataset and a secondary y axis (eventhough it's not that scientific but thats my problem (; )
The plot is more or less complete but the boxplots of both datasets are overlapping. Therefore I want to move the plots of one dataset to the rigth and the other to the left.
To give you an idea of my data: I have three treatments (a b c). From each specimen I have two different sample types (t1 t2) in which I measured the same value. Due to the nature of the sample types the values of one are around 100 and the others around 1. To make it more clear and visualy comparable a secondary y axis is inevitable.
My scipt so far is:

par(mar = c(5, 4, 4, 4) + 0.3)
boxplot(data$t1~data$Treatment, xlab= "Treatment", ylab="scale_t1", boxwex=0.3)
par (new=TRUE)
boxplot(data$t2~data$Treatment, pch=15, axes=FALSE, xlab= "", ylab="", boxwex=0.3)
mtext("scale_t2", side=4, line=2)
axis(4, las=1)

Does anyone how to move the boxplots to get two above eacht treatment or has another idea of how to create such plot?

Thanks a lot!

-tolbus