I am plotting a dataset using scatterplot3d
and I need to draw a cylinder containing it. What is the easiest way to do that?
An example dataset can be downloaded from here. The cylinder should be centred in (100,100) and have radius 100.
This is the code I am using to plot the points:
library(ggplot2)
library(plotly)
require(plot3D)
library(rgl)
require(gridExtra)
library(scatterplot3d)
Data = read.table("data.txt")
X = as.numeric(unlist(Data[1]))
Y = as.numeric(unlist(Data[2]))
Z = as.numeric(unlist(Data[3]))
# 3D plot
scatterplot3d(X, Y, Z, pch = 16)