fx <- function(x){x^4-x^2+6} sfx <- function(x){12/(abs(x)+1)} gx <- function(x){1/2*cos(6*x)+7/2} plot(gx,-2,2,xlim=c(-7,7),ylim=c(0,7),xlab="",ylab="") par(new=T) plot(sfx,-7,-1,xlim=c(-7,7),ylim=c(0,7),axes=F,xlab="",ylab="") par(new=T) plot(sfx,1,7,xlim=c(-7,7),ylim=c(0,7),axes=F,xlab="",ylab="") par(new=T) plot(fx,-1,1,xlim=c(-7,7),ylim=c(0,7),axes=F,xlab="",ylab="") gx <- function(x){ x[-2>x