# Cool 3D plots

**R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Some time ago I worked with a supplier who creates excellent cooling equipment for industrial use. Basically an impressive watercooler. The cooling capacity of these devices is depending on the temperature outside and of the temperature of the cooling water. This means that the advertised cooling capacity is just an indicative number and that you have to dig a bit deeper and look at the application.

Anyway, a few examples of plotting with the `plot3D`

package. First create the matrices for x, y and z. Then plot it with `surf3D`

.

library(plot3D) z <- matrix(c(66.5, 69.6, 72.0, 74.1, 76.5, 79.0, 66.5, 69.6, 72.0, 74.1, 76.5, 79.0, 66.3, 68.4, 70.6, 72.9, 75.3, 77.7, 63.1, 65.3, 67.5, 69.6, 71.8, 74.1, 59.8, 61.8, 63.9, 65.9, 68.0, 70.2, 56.1, 58.1, 59.8, 62.0, 63.9, 65.9, 51.6, 53.9, 55.5, 57.5, 59.4, 61.4, 47.7, 49.4, 51.0, 52.8, 54.7, 56.5, 44.9, 46.5, 48.3, 49.8, 51.6, 53.3, 40.2, 41.6, 43.0, 44.7, 46.1, 47.9), ncol=6, byrow=TRUE) x <- matrix(c(-25,10,15,20,25,30,35,40,45,50), ncol=6, nrow=10) y <- matrix(c(10,11,12,13,14,15),nrow=10,ncol=6, byrow=TRUE) surf3D(x,y,z,colvar=z, facets = TRUE, theta = 40, phi = 20, border = "darkgrey", col = jet.col(100), expand= 0.75, inttype = 3, bty= "b2", ticktype= "detailed", xlab= "Ambient Temp. [\u00B0C]", xlim= c(-30,50), ylab= "Supply Temp. [\u00B0C]", zlab= "Cooling Capacity [kW]", zlim= c(35,85), clab= c("Cooling Capacity","[kW]"), main= "Cooling Performance Fancy Chiller")

Multiple overlapping graphs can demonstrate the relation between various factors. For example the required power versus the Coefficient of Performance (CoP) of the chiller. Simple create a second plot as shown above and add `add=TRUE`

to your code. All general parameters like axis size and labelling are taken from the first plot. What you see here is that the required power increases with a higher ambient temperature and the the efficiency decreases (how surprising).

**leave a comment**for the author, please follow the link and comment on their blog:

**R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.