简体   繁体   中英

3d surface plot in R, with z dimension changing over time

I have a dataset with a xyz structure.

X = age of arrival in the city
Y = year of arrival
Z = number of current survivors from X/Y combination

I have no problem plotting this for any given time using RGL in R. However I would like to introduce a time dimension. I could of course make 23 plots and paste them together, but I would like to be able to manipulate the viewing on the fly, and treat the whole time series as one plot. I have Z values for 23 years. I also would like to colour my plot with an extra z2 variable, being z_year/z_(year-1). Is this possible within the RGl pakcage with some programming or is there a better package available?

Try creating a video like described on SO..

Alternative is a for-loop with a plot and delaying it -> look at ?Sys.sleep

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM