Learn R Programming

plotrix (version 2.0.2)

gap.plot: Display a plot with a gap (missing range) on one axis

Description

Displays a plot with a missing range.

Usage

gap.plot(x,y,gap,gap.side="y",xaxlab,xtics,yaxlab,ytics,
  col=par("col"),...)

Arguments

x,y
data values
gap
the range of values to be left out
gap.side
whether the gap is to be on the x or y axis
xaxlab
labels for the x axis ticks
xtics
position of the x axis ticks
yaxlab
labels for the y axis ticks
ytics
position of the y axis ticks
col
color(s) in which to plot the values
...
arguments passed to plot.

Value

  • nil

Details

Displays a plot omitting a range of values on one axis. Typically used when there is a relatively large gap in the overall range of one set of values. See axis.break for a brief discussion of plotting on discontinuous coordinates.

See Also

gap.barplot

Examples

Run this code
twogrp<-c(rnorm(10)+4,rnorm(10)+20)
 gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values",
  main="Plot gap on Y axis")
 if(dev.interactive()) par(ask=TRUE)
 gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.side="x",xlab="X values",
  xtics=c(4,7,17,20),ylab="Y values",main="Plot gap on X axis") 
 par(ask=FALSE)

Run the code above in your browser using DataLab