Reader small image

You're reading from  Data Wrangling with R

Product typeBook
Published inFeb 2023
PublisherPackt
ISBN-139781803235400
Edition1st Edition
Concepts
Right arrow
Author (1)
Gustavo R Santos
Gustavo R Santos
author image
Gustavo R Santos

Gustavo R Santos has worked in the Technology Industry for 13 years, improving processes, and analyzing datasets and creating dashboards. Since 2020, he has been working as a Data Scientist in the retail industry, wrangling, analyzing, visualizing and modeling data with the most modern tools like R, Python and Databricks. Gustavo also gives lectures from time to time at an online school about Data Science concepts. He has a background in Marketing, is certified as Data Scientist by the Data Science Academy Brazil and pursues his specialist MBA in Data Science at the University of São Paulo
Read more about Gustavo R Santos

Right arrow

3D plots

3-dimensional plots are beautiful. Very often, they create a good impression with their audience, but the truth is that they are not the best type of graphic to use. To plot a 3D graphic on a 2D space, such as on a computer screen or on paper, the third dimension will have to simulate depth that does not exist. It is not recommended that you plot in 3D very often, as in general, a good old 2D plot will be the simplest and best option.

Sometimes, though, looking at 3D plots can be useful. Cases such as surface graphics, which can represent the surface of a given place, such as a mountain, can be interesting.

3D graphics can be created using the plotly library in R (loaded with library(plotly)). Let’s create a random surface and plot it. The surface graphics require the input data to be a matrix, thus we are creating one and then using the plot_ly() function, passing the z= ~surface argument to it to indicate that we want a 3D graphic. Remember that x and y are...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Data Wrangling with R
Published in: Feb 2023Publisher: PacktISBN-13: 9781803235400

Author (1)

author image
Gustavo R Santos

Gustavo R Santos has worked in the Technology Industry for 13 years, improving processes, and analyzing datasets and creating dashboards. Since 2020, he has been working as a Data Scientist in the retail industry, wrangling, analyzing, visualizing and modeling data with the most modern tools like R, Python and Databricks. Gustavo also gives lectures from time to time at an online school about Data Science concepts. He has a background in Marketing, is certified as Data Scientist by the Data Science Academy Brazil and pursues his specialist MBA in Data Science at the University of São Paulo
Read more about Gustavo R Santos