简体   繁体   中英

Code for 3d graph in r or matlab

How to make a graph using either r or matlab or any other related language to accomplish something like this

在此处输入图片说明

It has to be a 3d graph with 3 graphs with each axis being zero one after the other

 VitC Linalool      Cu 
1  16.00000    31.25   0.000   
2   8.00000    62.50   0.000   
3   8.00000   125.00   0.000   
4   4.00000   250.00   0.000   
5   1.00000   500.00   0.000   
6   0.12500  1000.00   0.000   
7   0.06250  2000.00   0.000   
8   0.03125  4000.00   0.000  
9   0.00000   250.00 250.000   
10  0.00000   500.00 125.000   
11  0.00000  1000.00  62.500   
12  0.00000  2000.00  15.625   
13  0.00000  4000.00   0.488   
14  0.50000     0.00  62.500   
15  1.00000     0.00  31.250   
16  2.00000     0.00  31.250   
17  4.00000     0.00  15.625  
18  8.00000     0.00  15.625   
19 16.00000     0.00  15.625   
20 32.00000     0.00   7.810   
21 64.00000     0.00   3.960 

PS: A line graph would be preffered Thank you for your help

I used R with rgl package. ?plot3d , ?axes3d , etc will teach you how to customize.

plot3d(data, box=F)
lines3d(subset(data, Cu==0), col=2, lwd=2)
lines3d(subset(data, VitC==0), col=3, lwd=2)
lines3d(subset(data, Linalool==0), col=4, lwd=2)
grid3d(c("x", "y","z"), col = "gray90")

在此处输入图片说明

ggplot2 and qplot in R are strong plotting tools. As the " r-blogger " site mentioned the scatterplot3d package from R core members Uwe Ligges and Martin Machler is the "go-to" package for 3D scatter plots.

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