0

I have two outliers I do not want to omit from a plot so I am using gap.boxplot in the plotrix package. The range is great enough that I made two breaks. The lower range should be 0-400, middle 2050-2150, and upper 4850-5000. I've made a plot I am happy with, but the tics on the y-axis are not displaying correctly.

How can I change the tics so the correct ranges are displayed on the y-axis?

gap.boxplot(data$a ~ data$month,
gap=list(top=c(2150,4850),bottom=c(400,2050))
ytics = seq(0, 5000, by = 50), 
axis.labels=T)


zz = 
s_id    month   a  
1   jun 0  
2   jun 1  
3   jun 3  
4   jul 28  
5   jul 56  
6   jul 43  
7   jun 0  
8   jun 4900  
9   jun 8  
10  jul 12  
11  jul 56  
12  jul 92  
13  jul 4  
14  jul 0  
15  jul 0  
16  jun 356  
17  jun 0  
18  jun 49  
19  jun 2100  
20  jun 0  
21  jun 89

data = read.table(text=zz, header = TRUE)

  • 1
    You are much more likely to receive a helpful answer if you provide a [minimal, reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) together with the code you have tried. Thanks! – Henrik Oct 30 '13 at 20:52
  • Thanks, @Henrik! My bad, first post... I added an example subsetted from my data. – user2283982 Oct 31 '13 at 00:58
  • The gap arguments are supposed to be the ranges below and above the box range. There isn't much point in having a bottom gap. Doing so gets the labeling in a useless range. – IRTFM Oct 31 '13 at 01:55
  • @DWin, Using the top and bottom gap was the only way I knew to have two breaks. My data are plotting correctly the problem is that the the y-axis tics are not the correct range. Do you have a suggestion for getting the labeling in a useful range? – user2283982 Oct 31 '13 at 18:45
  • The problem is that the `axis` function only has a side argument. There is no provision for multiple ranges on the `axis(side = 2 , ...)` call. You probably need to look at how `plotrix::gap.plot` works. I would instead of trying to label the axis ticks just label the values of the the outliers with `text`. – IRTFM Oct 31 '13 at 20:43

0 Answers0