#an egg
color <-greycol(100)
emptyplot(c(-3.2,3.2),col=color[length(color)],main="filledshape")
b<-4
a<-9
x <- seq(-sqrt(a),sqrt(a),by=0.01)
g <- b-b/a*x^2-0.2*b*x+0.2*b/a*x^3
g[g<0] <- 0
x1 <-c(x,rev(x))
g1 <-c(sqrt(g),rev(-sqrt(g)))
xouter <-cbind(x1,g1)
xouter <-rbind(xouter,xouter[1,])
filledshape(xouter,xyinner=c(-1,0),col=color)
# a mill
color <-shadepalette(grey(0.3),"yellow",n=50)
emptyplot(c(-3.3,3.3),col=color[length(color)],main="filledshape")
x <- seq(0,0.8*pi,pi/100)
y <- sin(x)
xouter <- cbind(x,y)
for (i in seq(0,360,60))
xouter <- rbind(xouter,rotatexy(cbind(x,y),mid=c(0,0),angle = i))
filledshape(xouter,c(0,0),col=color)
# abstract art
emptyplot(col="darkgrey",main="filledshape")
filledshape(matrix(nc=2,runif(100)),col="darkblue")
Run the code above in your browser using DataLab