Pergunta

I am trying to plot a set of data in R

x <- c(1,4,5,3,2,25)

my Y scale is fixed at 20 so that the last datapoint would effectively not be visible on the plot if i execute the following code

plot(x, ylim=c(0,20), type='l')

i wanted to show the range of the outlying datapoint by showing a smaller box above the plot, with an independent Y scale, representing only this last datapoint.

is there any package or way to approach this problem?

Foi útil?

Solução

You may try axis.break (plotrix package) http://rss.acs.unt.edu/Rdoc/library/plotrix/html/axis.break.html, with which you can define the axis to break, the style, size and color of the break marker. The potential disadvantage of this approach is that the trend perception might be fooled. Good luck!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top