SlideShare una empresa de Scribd logo
1 de 16
Prepared by Volkan OBAN
Plot3D package in R and examples,etc.
Reference: http://www.sthda.com/english/wiki/impressive-package-for-3d-and-4d-graph-r-
software-and-data-visualization
text3D: plot 3-dimensionnal texts
The function text3D() is used as follow:
text3D(x, y, z, labels, ...)
The USArrests data sets will be used in the example below:
data(USArrests)
with(USArrests, text3D(Murder, Assault, Rape,
labels = rownames(USArrests), colvar = UrbanPop,
col = gg.col(100), theta = 60, phi = 20,
xlab = "Murder", ylab = "Assault", zlab = "Rape",
main = "USA arrests", cex = 0.6,
bty = "g", ticktype = "detailed", d = 2,
clab = c("Urban","Pop"), adj = 0.5, font = 2))
# Plot texts
with(USArrests, text3D(Murder, Assault, Rape, labels = rownames(USArrests),
colvar = UrbanPop, col = gg.col(100), theta = 60, phi = 20, xlab = "Murder",
ylab = "Assault", zlab = "Rape", main = "USA arrests", cex = 0.6, bty = "g",
ticktype = "detailed", d = 2, clab = c("Urban","Pop"), adj = 0.5, font = 2)) #
Add points with(USArrests, scatter3D(Murder, Assault, Rape - 1, colvar =
UrbanPop, col = gg.col(100), type = "h", pch = ".", add = TRUE))
plotdev(xlim = c(0, 10), ylim = c(40, 150), zlim = c(7, 25))
Histogram3D
data(VADeaths)
# hist3D and ribbon3D with greyish background, rotated, rescaled,...
hist3D(z = VADeaths, scale = FALSE, expand = 0.01, bty = "g", phi = 20, col =
"#0072B2", border = "black", shade = 0.2, ltheta = 90, space = 0.3, ticktype
= "detailed", d = 2)
hist3D (x = 1:5, y = 1:4, z = VADeaths, bty = "g", phi = 20, theta = -60,
xlab = "", ylab = "", zlab = "", main = "VADeaths", col = "#0072B2", border =
"black", shade = 0.8, ticktype = "detailed", space = 0.15, d = 2, cex.axis =
1e-9)
# Use text3D to label x axis
text3D(x = 1:5, y = rep(0.5, 5), z = rep(3, 5), labels =
rownames(VADeaths), add = TRUE, adj = 0)
# Use text3D to label yaxis
text3D(x = rep(1, 4), y = 1:4, z = rep(0, 4), labels = colnames(VADeaths),
add = TRUE, adj = 1)
hist3D_fancy(iris$Sepal.Length, iris$Petal.Width,
+ colvar=as.numeric(iris$Species))
Example:
x0 <- c(0, 0, 0, 0)
> y0 <- c(0, 0, 0, 0)
> z0 <- c(0, 0, 0, 0)
> x1 <- c(0.89, -0.46, 0.99, 0.96)
> y1 <- c(0.36, 0.88, 0.02, 0.06)
> z1 <- c(-0.28, 0.09, 0.05, 0.24)
> cols <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A")
> arrows3D(x0, y0, z0, x1, y1, z1, colvar = x1^2, col = cols,
+ lwd = 2, d = 3, clab = c("Quality", "score"),
+ main = "Arrows 3D", bty ="g", ticktype = "detailed")
> # Add starting point of arrow
> points3D(x0, y0, z0, add = TRUE, col="darkred",
+ colkey = FALSE, pch = 19, cex = 1)
> # Add labels to the arrows
> text3D(x1, y1, z1, c("Sepal.L", "Sepal.W", "Petal.L", "Petal.W"),
+ colvar = x1^2, col = cols, add=TRUE, colkey = FALSE)
EXAMPLE:
data(iris)
x <- iris$Sepal.Length
y <- iris$Petal.Length
z <- iris$Sepal.Width
scatter3D(x, y, z, pch = 18, bty = "u", colkey = FALSE,
+ main ="bty= 'u'", col.panel ="steelblue", expand =0.4,
+ col.grid = "darkblue")
> scatter3D(x, y, z, bty = "g", pch = 18, col = gg.col(100))
> # ramp.col: custom palettes
> scatter3D(x, y, z, bty = "g", pch = 18,
+ col = ramp.col(c("blue", "yellow", "red")) )
> scatter3D(x, y, z, phi = 0, bty = "g",
+ pch = 20, cex = 2, ticktype = "detailed")
scatter3D(x, y, z, phi = 0, bty = "g", type = "l", ticktype = "detailed", lwd =
4)
scatter3D(x, y, z, phi = 0, bty = "g", type = "h",
+ ticktype = "detailed", pch = 19, cex = 0.5)
> x <- mtcars$wt
> y <- mtcars$disp
> z <- mtcars$mpg
> # Compute the linear regression (z = ax + by + d)
> fit <- lm(z ~ x + y)
> # predict values on regular xy grid
> grid.lines = 26
> x.pred <- seq(min(x), max(x), length.out = grid.lines)
> y.pred <- seq(min(y), max(y), length.out = grid.lines)
> xy <- expand.grid( x = x.pred, y = y.pred)
> z.pred <- matrix(predict(fit, newdata = xy),
+ nrow = grid.lines, ncol = grid.lines)
> # fitted points for droplines to surface
> fitpoints <- predict(fit)
> # scatter plot with regression plane
> scatter3D(x, y, z, pch = 18, cex = 2,
+ theta = 20, phi = 20, ticktype = "detailed",
+ xlab = "wt", ylab = "disp", zlab = "mpg",
+ surf = list(x = x.pred, y = y.pred, z = z.pred,
+ facets = NA, fit = fitpoints), main = "mtcars")

Más contenido relacionado

Destacado

Kelompok kepala bidang dan kepala seksi
Kelompok kepala bidang dan kepala seksiKelompok kepala bidang dan kepala seksi
Kelompok kepala bidang dan kepala seksi
y76u
 
Planned Preventive Ambulance Medical Equipment Maintenance
Planned Preventive Ambulance Medical Equipment MaintenancePlanned Preventive Ambulance Medical Equipment Maintenance
Planned Preventive Ambulance Medical Equipment Maintenance
Ashendu Pandey
 

Destacado (18)

Curso básico de bolsa
Curso básico de bolsaCurso básico de bolsa
Curso básico de bolsa
 
Scan_Doc0005
Scan_Doc0005Scan_Doc0005
Scan_Doc0005
 
Checkmate to crypto malware. Scacco matto ai crypto malware
Checkmate to crypto malware. Scacco matto ai crypto malwareCheckmate to crypto malware. Scacco matto ai crypto malware
Checkmate to crypto malware. Scacco matto ai crypto malware
 
Kelompok kepala bidang dan kepala seksi
Kelompok kepala bidang dan kepala seksiKelompok kepala bidang dan kepala seksi
Kelompok kepala bidang dan kepala seksi
 
東京の魅⼒発信(Tokyoの押し売り) 東京odd2016
東京の魅⼒発信(Tokyoの押し売り) 東京odd2016東京の魅⼒発信(Tokyoの押し売り) 東京odd2016
東京の魅⼒発信(Tokyoの押し売り) 東京odd2016
 
Email Pitches
Email PitchesEmail Pitches
Email Pitches
 
resume
resumeresume
resume
 
子育て(みんなで子育て支援アプリGreatサポーター) 東京odd2016
子育て(みんなで子育て支援アプリGreatサポーター) 東京odd2016子育て(みんなで子育て支援アプリGreatサポーター) 東京odd2016
子育て(みんなで子育て支援アプリGreatサポーター) 東京odd2016
 
2016 pitch project Assen-Oost
2016 pitch project Assen-Oost2016 pitch project Assen-Oost
2016 pitch project Assen-Oost
 
Blizzard Premium refrigeration
Blizzard Premium refrigerationBlizzard Premium refrigeration
Blizzard Premium refrigeration
 
peradilan khusus pemilu
peradilan khusus pemiluperadilan khusus pemilu
peradilan khusus pemilu
 
6 Consigli per Difendere i tuoi Figli dal Cyberbullismo
6 Consigli per Difendere i tuoi Figli dal Cyberbullismo6 Consigli per Difendere i tuoi Figli dal Cyberbullismo
6 Consigli per Difendere i tuoi Figli dal Cyberbullismo
 
artificial lift methods
artificial lift methodsartificial lift methods
artificial lift methods
 
SIGNOS EVIDENTES DE QUE USTED NECESITA CAMBIAR DE GRUPO DE TRADING
SIGNOS  EVIDENTES DE QUE USTED NECESITA CAMBIAR DE GRUPO DE TRADINGSIGNOS  EVIDENTES DE QUE USTED NECESITA CAMBIAR DE GRUPO DE TRADING
SIGNOS EVIDENTES DE QUE USTED NECESITA CAMBIAR DE GRUPO DE TRADING
 
Construction Equipment Sectore Report - January 2017
Construction Equipment Sectore Report - January 2017Construction Equipment Sectore Report - January 2017
Construction Equipment Sectore Report - January 2017
 
Partial replacement of Fine aggreggate by Copper Slag and Cement by Fly Ash
Partial replacement of Fine aggreggate by Copper Slag and Cement by Fly AshPartial replacement of Fine aggreggate by Copper Slag and Cement by Fly Ash
Partial replacement of Fine aggreggate by Copper Slag and Cement by Fly Ash
 
Planned Preventive Ambulance Medical Equipment Maintenance
Planned Preventive Ambulance Medical Equipment MaintenancePlanned Preventive Ambulance Medical Equipment Maintenance
Planned Preventive Ambulance Medical Equipment Maintenance
 
Top 6 Must Do’s to Real-time Brandscaping Success!
Top 6 Must Do’s to Real-time Brandscaping Success!Top 6 Must Do’s to Real-time Brandscaping Success!
Top 6 Must Do’s to Real-time Brandscaping Success!
 

Similar a Plot3D package in R-package-for-3d-and-4d-graph-Data visualization.

Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Vyacheslav Arbuzov
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
Amit Kapoor
 
Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2
rampan
 

Similar a Plot3D package in R-package-for-3d-and-4d-graph-Data visualization. (20)

Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
 
An example of R code for Data visualization
An example of R code for Data visualizationAn example of R code for Data visualization
An example of R code for Data visualization
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
 
Артём Акуляков - F# for Data Analysis
Артём Акуляков - F# for Data AnalysisАртём Акуляков - F# for Data Analysis
Артём Акуляков - F# for Data Analysis
 
Surface3d in R and rgl package.
Surface3d in R and rgl package.Surface3d in R and rgl package.
Surface3d in R and rgl package.
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
 
Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2
 
R scatter plots
R scatter plotsR scatter plots
R scatter plots
 
Genomic Graphics
Genomic GraphicsGenomic Graphics
Genomic Graphics
 
Frsa
FrsaFrsa
Frsa
 
Python grass
Python grassPython grass
Python grass
 
R for you
R for youR for you
R for you
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangle
 

Más de Dr. Volkan OBAN

Más de Dr. Volkan OBAN (20)

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - Example
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) Parametreleri
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - Examples
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in Python
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R
 
R forecasting Example
R forecasting ExampleR forecasting Example
R forecasting Example
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision Making
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonScikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
 
Pandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetPandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheet
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package Examples
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.
 

Último

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
gajnagarg
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
gajnagarg
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 

Último (20)

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 

Plot3D package in R-package-for-3d-and-4d-graph-Data visualization.

  • 1. Prepared by Volkan OBAN Plot3D package in R and examples,etc. Reference: http://www.sthda.com/english/wiki/impressive-package-for-3d-and-4d-graph-r- software-and-data-visualization text3D: plot 3-dimensionnal texts The function text3D() is used as follow: text3D(x, y, z, labels, ...) The USArrests data sets will be used in the example below: data(USArrests) with(USArrests, text3D(Murder, Assault, Rape, labels = rownames(USArrests), colvar = UrbanPop, col = gg.col(100), theta = 60, phi = 20, xlab = "Murder", ylab = "Assault", zlab = "Rape", main = "USA arrests", cex = 0.6, bty = "g", ticktype = "detailed", d = 2, clab = c("Urban","Pop"), adj = 0.5, font = 2))
  • 2.
  • 3. # Plot texts with(USArrests, text3D(Murder, Assault, Rape, labels = rownames(USArrests), colvar = UrbanPop, col = gg.col(100), theta = 60, phi = 20, xlab = "Murder", ylab = "Assault", zlab = "Rape", main = "USA arrests", cex = 0.6, bty = "g", ticktype = "detailed", d = 2, clab = c("Urban","Pop"), adj = 0.5, font = 2)) # Add points with(USArrests, scatter3D(Murder, Assault, Rape - 1, colvar = UrbanPop, col = gg.col(100), type = "h", pch = ".", add = TRUE)) plotdev(xlim = c(0, 10), ylim = c(40, 150), zlim = c(7, 25))
  • 4. Histogram3D data(VADeaths) # hist3D and ribbon3D with greyish background, rotated, rescaled,... hist3D(z = VADeaths, scale = FALSE, expand = 0.01, bty = "g", phi = 20, col = "#0072B2", border = "black", shade = 0.2, ltheta = 90, space = 0.3, ticktype = "detailed", d = 2)
  • 5. hist3D (x = 1:5, y = 1:4, z = VADeaths, bty = "g", phi = 20, theta = -60, xlab = "", ylab = "", zlab = "", main = "VADeaths", col = "#0072B2", border = "black", shade = 0.8, ticktype = "detailed", space = 0.15, d = 2, cex.axis = 1e-9) # Use text3D to label x axis text3D(x = 1:5, y = rep(0.5, 5), z = rep(3, 5), labels = rownames(VADeaths), add = TRUE, adj = 0) # Use text3D to label yaxis text3D(x = rep(1, 4), y = 1:4, z = rep(0, 4), labels = colnames(VADeaths), add = TRUE, adj = 1)
  • 6.
  • 7.
  • 9. Example: x0 <- c(0, 0, 0, 0) > y0 <- c(0, 0, 0, 0) > z0 <- c(0, 0, 0, 0) > x1 <- c(0.89, -0.46, 0.99, 0.96) > y1 <- c(0.36, 0.88, 0.02, 0.06) > z1 <- c(-0.28, 0.09, 0.05, 0.24) > cols <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A") > arrows3D(x0, y0, z0, x1, y1, z1, colvar = x1^2, col = cols, + lwd = 2, d = 3, clab = c("Quality", "score"), + main = "Arrows 3D", bty ="g", ticktype = "detailed") > # Add starting point of arrow > points3D(x0, y0, z0, add = TRUE, col="darkred", + colkey = FALSE, pch = 19, cex = 1) > # Add labels to the arrows > text3D(x1, y1, z1, c("Sepal.L", "Sepal.W", "Petal.L", "Petal.W"), + colvar = x1^2, col = cols, add=TRUE, colkey = FALSE)
  • 10. EXAMPLE: data(iris) x <- iris$Sepal.Length y <- iris$Petal.Length z <- iris$Sepal.Width scatter3D(x, y, z, pch = 18, bty = "u", colkey = FALSE, + main ="bty= 'u'", col.panel ="steelblue", expand =0.4, + col.grid = "darkblue")
  • 11.
  • 12. > scatter3D(x, y, z, bty = "g", pch = 18, col = gg.col(100)) > # ramp.col: custom palettes > scatter3D(x, y, z, bty = "g", pch = 18, + col = ramp.col(c("blue", "yellow", "red")) )
  • 13. > scatter3D(x, y, z, phi = 0, bty = "g", + pch = 20, cex = 2, ticktype = "detailed")
  • 14. scatter3D(x, y, z, phi = 0, bty = "g", type = "l", ticktype = "detailed", lwd = 4)
  • 15. scatter3D(x, y, z, phi = 0, bty = "g", type = "h", + ticktype = "detailed", pch = 19, cex = 0.5)
  • 16. > x <- mtcars$wt > y <- mtcars$disp > z <- mtcars$mpg > # Compute the linear regression (z = ax + by + d) > fit <- lm(z ~ x + y) > # predict values on regular xy grid > grid.lines = 26 > x.pred <- seq(min(x), max(x), length.out = grid.lines) > y.pred <- seq(min(y), max(y), length.out = grid.lines) > xy <- expand.grid( x = x.pred, y = y.pred) > z.pred <- matrix(predict(fit, newdata = xy), + nrow = grid.lines, ncol = grid.lines) > # fitted points for droplines to surface > fitpoints <- predict(fit) > # scatter plot with regression plane > scatter3D(x, y, z, pch = 18, cex = 2, + theta = 20, phi = 20, ticktype = "detailed", + xlab = "wt", ylab = "disp", zlab = "mpg", + surf = list(x = x.pred, y = y.pred, z = z.pred, + facets = NA, fit = fitpoints), main = "mtcars")