I saw this 3D picture the other day in a journal that describes the evolution over time of Birth Rates between 1980-1999 by age. The vertical line is the birth rates. The two horizontal lines are, age, and year.
I really would like to reproduce one like this. I can imagine the data would look something like (simplified)
dta = cbind(c(2000, 2005, 2015),
c(15, 20, 25),
c(20, 24, 35))
colnames(dta) <- c('year', 'age', 'rate')
year age rate
2000 15 20
2005 20 24
2015 25 35
I searched for some 3D libraries and package plot3D
came out. I tried to figure out how the function outer()
works but I couldn't understand!
Do you have any ideas how I could reproduce a 3D plot like the one above?
Try this:
Ref:
demo(persp)
in RNote: The thirs argument (z) must be a matrix