首页 > 解决方案 > 如何使用 R 中的植被数据执行 3d 散点图?

问题描述

我想做以下信息的 3d 散点图。变量是x: 地面粗糙度y粗糙度指数z =植被存在的概率

我想表明,当粗糙度越大时,植被的可能性就越大。

在一篇文章中,我发现了这张图,我想复制它:

在此处输入图像描述

我查找了信息,但无法获得我感兴趣的图表。

dput(R[1:500,2:4]) structure(list(lyr17_veg_map_sp_holdout_probability.2 = c(0.444000006, 0.526000023, 0.660000026, 0.54400003, 0.649999976, 0.621999979, 0.477999985, 0.684000015, 0.572000027, 0.574000001, 0.453999996, 0.469999999, 0.582000017, 0.614000022, 0.515999973, 0.68599999, 0.617999971, 0.505999982, 0.453999996, 0.414000005, 0.550000012, 0.474000007, 0.442000002, 0.628000021, 0.702000022, 0.688000023, 0.628000021, 0.540000021, 0.565999985, 0.717999995, 0.666000009, 0.536000013, 0.493999988, 0.405999988, 0.634000003, 0.578000009, 0.639999986, 0.593999982, 0.518000007, 0.638000011, 0.629999995, 0.737999976, 0.635999978, 0.662, 0.479999989, 0.578000009, 0.574000001, 0.628000021, 0.492000014, 0.409999996, 0.698000014, 0.65200001, 0.667999983, 0.488000005, 0.681999981, 0.601999998, 0.657999992, 0.565999985, 0.59799999, 0.469999999, 0.674000025, 0.70599997, 0.653999984, 0.569999993, 0.404000014, 0.768000007, 0.694000006, 0.589999974, 0.666000009, 0.653999984, 0.660000026, 0.453999996, 0.560000002, 0.5, 0.596000016, 0.574000001, 0.624000013, 0.589999974, 0.558000028, 0.526000023, 0.653999984, 0.723999977, 0.666000009, 0.638000011, 0.730000019, 0.526000023, 0.505999982, 0.572000027, 0.634000003, 0.660000026, 0.69599998, 0.527999997, 0.727999985, 0.432000011, 0.628000021, 0.75, 0.758000016, 0.653999984, 0.606000006, 0.523999989, 0.375999987, 0.601999998, 0.488000005, 0.505999982, 0.712000012, 0.648000002, 0.629999995, 0.589999974, 0.55400002, 0.667999983, 0.632000029, 0.603999972, 0.589999974, 0.632000029, 0.526000023, 0.430000007, 0.286000013, 0.432000011, 0.726000011, 0.568000019, 0.635999978, 0.526000023, 0.361999989, 0.560000002, 0.635999978, 0.463999987, 0.671999991, 0.615999997, 0.342000008, 0.568000019, 0.593999982, 0.465999991, 0.463999987, 0.469999999, 0.65200001, 0.777999997, 0.555999994, 0.646000028, 0.722000003, 0.675999999, 0.5, 0.532000005, 0.579999983, 0.666000009, 0.519999981, 0.579999983, 0.501999974, 0.458000004, 0.34799999, 0.606000006, 0.588, 0.745999992, 0.75, 0.621999979, 0.731999993, 0.589999974, 0.550000012, 0.648000002, 0.667999983, 0.763999999, 0.643999994, 0.70599997, 0.442000002, 0.493999988, 0.501999974, 0.479999989, 0.419999987, 0.451999992, 0.680000007, 0.657999992, 0.703999996, 0.741999984, 0.634000003, 0.723999977, 0.779999971, 0.69599998, 0.811999977, 0.663999975, 0.68599999, 0.80400002, 0.379999995, 0.349999994, 0.493999988, 0.460000008, 0.495999992, 0.639999986, 0.629999995, 0.560000002, 0.726000011, 0.765999973, 0.762000024, 0.680000007, 0.574000001, 0.69599998, 0.702000022, 0.629999995, 0.555999994, 0.702000022, 0.674000025, 0.345999986, 0.533999979, 0.55400002, 0.5, 0.628000021, 0.574000001, 0.681999981, 0.698000014, 0.787999988, 0.657999992, 0.731999993, 0.629999995, 0.603999972, 0.523999989, 0.492000014, 0.497999996, 0.526000023, 0.702000022, 0.505999982, 0.331999987, 0.600000024, 0.453999996, 0.458000004, 0.497999996, 0.629999995, 0.600000024, 0.703999996, 0.703999996, 0.702000022, 0.547999978, 0.565999985, 0.518000007, 0.662, 0.550000012, 0.526000023, 0.558000028, 0.529999971, 0.437999994, 0.296000004, 0.522000015, 0.479999989, 0.56400001, 0.547999978, 0.656000018, 0.582000017, 0.592000008, 0.551999986, 0.492000014, 0.536000013, 0.56400001, 0.586000025, 0.456, 0.493999988, 0.465999991, 0.519999981, 0.610000014, 0.512000024, 0.474000007, 0.460000008, 0.442000002, 0.550000012, 0.558000028, 0.657999992, 0.432000011, 0.691999972, 0.419999987, 0.601999998, 0.606000006, 0.504000008, 0.40200001, 0.495999992, 0.453999996, 0.505999982, 0.374000013, 0.621999979, 0.497999996, 0.624000013, 0.493999988, 0.537999988, 0.474000007, 0.515999973, 0.628000021, 0.620000005, 0.65200001, 0.734000027, 0.670000017, 0.660000026, 0.522000015, 0.361999989, 0.439999998, 0.398000002, 0.465999991, 0.467999995, 0.505999982, 0.546000004, 0.569999993, 0.588, 0.60799998, 0.586000025, 0.492000014, 0.515999973, 0.611999989, 0.497999996, 0.611999989, 0.495999992, 0.708000004, 0.582000017, 0.518000007, 0.667999983, 0.444000006, 0.472000003, 0.508000016, 0.671999991, 0.621999979, 0.588, 0.593999982, 0.586000025, 0.558000028, 0.513999999, 0.522000015, 0.515999973, 0.483999997, 0.551999986, 0.536000013, 0.579999983, 0.456, 0.449999988, 0.540000021, 0.488000005, 0.50999999, 0.572000027, 0.540000021, 0.437999994, 0.555999994, 0.527999997, 0.582000017, 0.589999974, 0.456, 0.515999973, 0.572000027, 0.54400003, 0.462000012, 0.43599999, 0.451999992, 0.578000009, 0.428000003, 0.505999982, 0.634000003, 0.50999999, 0.44600001, 0.536000013, 0.442000002, 0.558000028, 0.586000025, 0.513999999, 0.634000003, 0.634000003, 0.593999982, 0.639999986, 0.486000001, 0.540000021, 0.537999988, 0.527999997, 0.463999987, 0.409999996, 0.458000004, 0.639999986, 0.462000012, 0.558000028, 0.486000001, 0.519999981, 0.483999997, 0.561999977, 0.495999992, 0.560000002, 0.421999991, 0.493999988, 0.40200001, 0.603999972, 0.688000023, 0.479999989, 0.532000005, 0.428000003, 0.492000014, 0.398000002, 0.377999991, 0.560000002, 0.512000024, 0.50999999, 0.474000007, 0.467999995, 0.529999971, 0.463999987, 0.512000024, 0.532000005, 0.492000014, 0.513999999, 0.49000001, 0.505999982, 0.512000024, 0.523999989, 0.638000011, 0.476000011, 0.55400002, 0.639999986, 0.703999996, 0.603999972, 0.495999992, 0.428000003, 0.444000006, 0.433999985, 0.409999996, 0.474000007, 0.307999998, 0.384000003, 0.522000015, 0.508000016, 0.508000016, 0.481999993, 0.519999981, 0.50999999, 0.533999979, 0.596000016, 0.439999998, 0.35800001, 0.56400001, 0.561999977, 0.412, 0.55400002, 0.574000001, 0.56400001, 0.772000015, 0.437999994, 0.316000015, 0.49000001, 0.363999993, 0.483999997, 0.5, 0.305999994, 0.469999999, 0.541999996, 0.536000013, 0.518000007, 0.649999976, 0.50999999, 0.49000001, 0.497999996, 0.513999999, 0.453999996, 0.5, 0.625999987, 0.469999999, 0.558000028, 0.582000017, 0.583999991, 0.586000025, 0.786000013, 0.421999991, 0.593999982, 0.532000005, 0.540000021, 0.495999992, 0.59799999, 0.495999992, 0.523999989, 0.497999996, 0.472000003, 0.529999971, 0.536000013, 0.55400002, 0.5, 0.5, 0.533999979, 0.467999995, 0.565999985, 0.55400002, 0.615999997, 0.44600001, 0.522000015, 0.698000014, 0.526000023, 0.550000012, 0.54400003, 0.372000009, 0.407999992, 0.493999988, 0.611999989, 0.610000014, 0.519999981, 0.409999996, 0.546000004, 0.635999978, 0.550000012, 0.540000021, 0.555999994, 0.572000027, 0.586000025, 0.561999977, 0.55400002, 0.512000024, 0.54400003), lyr17_vm_TRI = c(1.018741608, 1.898422241, 1.59016037, 0.731349945, 0.506702423, 0.669364929, 0.983158112, 1.460777283, 1.126293182, 1.096321106, 1.68523407, 1.212741852, 0.398029327, 0.609077454, 0.85824585, 0.693790436, 1.378501892, 1.33927536, 1.13615036, 1.466972351, 1.004394531, 0.862640381, 1.114643097, 1.027637482, 0.751846313, 1.184238434, 1.429821014, 1.009338379, 0.57976532, 0.271396637, 0.403427124, 1.369628906, 1.149318695, 1.03086853, 0.937942505, 1.435035706, 1.374069214, 0.960483551, 1.354122162, 1.446735382, 0.745578766, 0.416069031, 0.356632233, 0.50120163, 1.262271881, 0.793346405, 0.804481506, 0.750488281, 1.220420837, 1.661140442, 0.884616852, 1.127254486, 1.313694, 1.111995697, 0.453170776, 0.513019562, 0.706298828, 1.064720154, 1.015323639, 0.75447464, 0.477481842, 0.584999084, 1.034420013, 1.195129395, 1.336235046, 1.002925873, 0.989738464, 0.534740448, 0.399044037, 0.44776535, 0.662437439, 1.600547791, 1.143844604, 1.155422211, 0.786727905, 0.985721588, 0.673664093, 1.068153381, 1.34771347, 1.060649872, 0.689170837, 0.557579041, 0.461349487, 0.492050171, 0.607738495, 1.075534821, 1.265277863, 1.723560333, 1.265346527, 1.139835358, 0.984230042, 1.036460876, 1.149250031, 1.20489502, 0.848018646, 0.647041321, 0.501888275, 0.45167923, 0.51505661, 0.76524353, 1.635704041, 1.834812164, 0.991443634, 0.829597473, 0.928245544, 0.837615967, 1.114578247, 1.535419464, 1.116176605, 0.718883514, 0.398609161, 0.368656158, 0.505146027, 0.855762482, 2.746429443, 1.801544189, 2.178859711, 1.591712952, 0.520202637, 0.864467621, 0.909881592, 0.961288452, 1.448471069, 1.449085236, 1.345630646, 1.035968781, 0.660881042, 0.701457977, 1.412509918, 1.089817047, 2.800983429, 2.366405487, 1.894313812, 1.659912109, 0.908740997, 0.867977142, 0.852657318, 0.765274048, 0.97756958, 1.071247101, 1.21005249, 0.785125732, 0.501960754, 0.866687775, 0.938854218, 0.853591919, 3.071552277, 2.017780304, 1.85062027, 1.81496048, 1.235298157, 0.884506226, 0.767505646, 0.643749237, 0.723972321, 1.035049438, 1.003635406, 0.468448639, 0.381969452, 0.454650879, 0.484069824, 0.558517456, 2.476306915, 3.260692596, 3.822223663, 2.32844162, 1.668956757, 2.042285919, 1.30406189, 1.135429382, 0.790035248, 0.7147789, 0.872447968, 0.9376297, 0.87361145, 0.724746704, 0.495967865, 0.482822418, 0.503890991, 0.709716797, 1.710041046, 3.108547211, 4.195171356, 2.983688354, 1.638523102, 1.655479431, 1.028663635, 1.003376007, 0.933280945, 0.898086548, 0.984725952, 0.94291687, 0.814208984, 0.799678802, 0.764011383, 0.732479095, 0.694892883, 0.756782532, 1.181797028, 2.3618927, 3.678195953, 3.885684967, 2.268352509, 1.208065033, 0.927032471, 0.745033264, 0.905986786, 0.977867126, 0.92339325, 0.768386841, 0.673442841, 0.616085052, 0.692630768, 0.556179047, 0.526767731, 0.610076904, 0.919200897, 1.051971436, 2.225711823, 2.98204422, 3.763526917, 3.292961121, 1.627773285, 1.227233887, 0.833679199, 0.896091461, 0.924385071, 0.83158493, 0.570419312, 0.309986115, 0.362869263, 0.532234192, 0.667201996, 0.598529816, 0.527511597, 1.025745392, 1.250137329, 2.083438873, 2.226039886, 2.98758316, 3.831375122, 2.304676056, 1.598968506, 0.896408081, 0.704219818, 0.704040527, 0.779418945, 0.407752991, 0.329410553, 0.521816254, 1.028964996, 0.766605377, 0.448436737, 0.380558014, 0.995109558, 1.347930908, 2.397281647, 2.018135071, 2.057533264, 3.922538757, 3.424125671, 1.421672821, 1.069171906, 0.65769577, 1.219631195, 0.464572906, 0.360229492, 0.43466568, 0.826747894, 0.808917999, 0.710231781, 0.38237381, 0.179710388, 1.261623383, 1.84563446, 2.204200745, 1.629238129, 1.75736618, 3.919967651, 3.588760376, 1.443916321, 1.052619934, 0.880561829, 1.035747528, 0.750312805, 0.518611908, 0.437175751, 1.220333099, 0.663105011, 1.006580353, 0.291374207, 0.134296417, 2.089763641, 2.167877197, 1.733707428, 1.339889526, 1.710681915, 3.932086945, 3.521408081, 1.619419098, 1.210838318, 1.202003479, 0.94140625, 1.136940002, 0.696346283, 0.677288055, 0.937164307, 0.641326904, 0.402362823, 0.370429993, 0.21818924, 2.509746552, 2.291431427, 1.784393311, 1.947784424, 2.529045105, 4.088554382, 2.961532593, 1.42382431, 1.118663788, 0.759174347, 0.722110748, 1.126731873, 0.936168671, 1.194610596, 0.654491425, 0.289043427, 0.240642548, 0.2302742, 0.314571381, 0.524147034, 0.678447723, 2.323154449, 1.764183044, 1.956680298, 2.221801758, 2.386234283, 3.731349945, 2.559436798, 0.907123566, 1.181762695, 0.809467316, 0.802585602, 0.920021057, 1.179386139, 0.701972961, 0.435043335, 0.185966492, 0.37140274, 0.182273865, 0.338039398, 0.510139465, 0.467704773, 1.384929657, 1.616153717, 1.349151611, 1.203327179, 1.609409332, 1.791679382, 1.372730255, 2.61265564, 3.419399261, 1.454673767, 1.242126465, 0.995800018, 0.889923096, 0.809280396, 0.43768692, 0.389884949, 0.148433685, 0.177898407, 0.347381592, 0.402141571, 0.341464996, 0.421333313, 0.391170502, 1.26083374, 1.153381348, 1.029735565, 0.993606567, 1.314128876, 1.554416656, 1.716487885, 3.106170654, 3.67987442, 2.152709961, 1.8891716, 2.162296295, 1.473754883, 0.568843842, 0.229934692, 0.322166443, 0.291629791, 0.251804352, 0.225585938, 0.186351776, 0.30513382, 0.414344788, 0.396446228, 1.653781891, 1.323532104, 1.025489807, 0.703006744, 0.941101074, 0.866439819, 0.933078766, 1.097328186, 2.476940155, 3.682186127, 2.933578491, 2.751247406, 2.484695435, 2.570949554, 1.827331543, 0.477508545, 0.234695435, 0.332164764, 0.463245392, 0.293151855, 0.187232971, 0.149044037, 0.435962677, 0.442100525, 0.254619598, 1.403308868, 1.201591492, 0.625080109, 0.522144318, 0.764003754, 0.785140991, 0.638076782, 1.397808075, 2.8697052, 2.744384766, 1.839473724, 1.429767609, 1.351127625, 1.985466003, 1.036567688, 0.517093658, 0.234794617, 0.456771851, 0.417778015, 0.307197571, 0.235977173, 0.12040329, 0.321208954, 0.482318878, 0.266475677, 1.268669128, 0.949634552, 0.481056213, 0.286247253, 0.681091309, 0.848304749, 0.464828491, 1.083332062, 2.859806061, 2.70640564, 1.235118866, 0.811710358, 0.734249115, 0.738697052, 0.479804993, 0.171596527, 0.472724915, 0.577045441, 0.388877869, 0.268863678, 0.245243073, 0.26316452, 0.287784576, 0.459064484, 0.283363342, 1.499629974, 0.9388237, 0.979885101, 0.558818817, 0.441280365, 0.698894501, 0.839004517, 0.75750351, 1.794662476, 2.579200745, 2.173908234, 1.321983337, 0.620326996, 0.559841156, 0.827880859, 0.522888184, 0.465190887, 0.356723785, 0.407020569, 0.250717163, 0.242443085, 0.327449799, 0.313220978, 0.325035095, 0.365177155, 0.487743378), lyr17_vm_roughness = c(2.988586426, 5.521240234, 5.039703369, 1.889678955, 2.008758545, 2.324188232, 2.321990967, 4.444793701, 3.836914063, 3.175598145, 5.193817139, 3.817382813, 1.26574707, 2.498535156, 2.570556641, 2.665222168, 4.852386475, 4.613098145, 4.866577148, 3.78704834, 3.926300049, 1.767456055, 3.691772461, 3.812561035, 2.447143555, 3.504302979, 4.460968018, 2.785858154, 3.162536621, 1.064697266, 1.270172119, 4.567565918, 4.068023682, 3.894104004, 3.353027344, 5.418792725, 4.656951904, 2.920257568, 4.030975342, 4.973999023, 2.795043945, 1.631439209, 1.1953125, 1.580108643, 3.176300049, 3.299438477, 2.140045166, 3.208618164, 4.163208008, 4.799560547, 2.875244141, 3.242980957, 4.668823242, 2.795043945, 1.625823975, 1.411773682, 2.863647461, 5.184906006, 4.394226074, 1.824645996, 1.644744873, 1.656036377, 3.533233643, 3.691925049, 3.728424072, 2.863372803, 3.496948242, 1.846862793, 1.335693359, 1.505645752, 2.426635742, 4.313903809, 4.736572266, 3.485870361, 3.102752686, 2.045471191, 2.31427002, 3.691925049, 3.931427002, 3.127655029, 2.722381592, 2.20022583, 1.740692139, 1.96963501, 1.499053955, 3.790161133, 5.059448242, 5.087677002, 3.458709717, 3.458709717, 3.318634033, 2.443572998, 3.931427002, 3.127655029, 3.299072266, 1.863433838, 1.79586792, 1.468475342, 1.329071045, 3.020324707, 4.016967773, 4.441680908, 2.142333984, 2.903289795, 3.38482666, 3.147186279, 4.234008789, 3.621185303, 4.334136963, 2.737945557, 1.786804199, 1.068359375, 2.390228271, 3.218994141, 9.093200684, 5.455841064, 3.961273193, 4.752929688, 2.060638428, 2.376525879, 2.417144775, 2.525817871, 3.530761719, 4.942901611, 4.60925293, 3.013061523, 1.348480225, 2.163330078, 3.029907227, 3.744598389, 8.399261475, 6.31048584, 5.130493164, 5.741546631, 2.965820313, 2.761871338, 3.499053955, 2.740692139, 3.11114502, 4.931274414, 2.907897949, 2.207519531, 1.579864502, 2.332611084, 3.029907227, 3.744598389, 9.01361084, 5.471801758, 5.829284668, 5.829284668, 4.523925781, 3.033203125, 2.463287354, 2.07522583, 2.696533203, 3.093780518, 2.532989502, 1.815582275, 1.259796143, 1.503417969, 1.966430664, 1.678894043, 7.858947754, 10.44894409, 11.86807251, 6.970062256, 5.692901611, 6.432525635, 4.030792236, 3.41973877, 3.126251221, 2.561737061, 2.847290039, 3.386657715, 3.000549316, 2.425079346, 1.75177002, 1.825958252, 2.066223145, 2.258514404, 6.197906494, 9.678894043, 12.14666748, 8.422058105, 4.888061523, 5.594604492, 2.92300415, 2.92300415, 2.495788574, 2.934661865, 3.357635498, 3.181365967, 2.612792969, 2.726409912, 2.713012695, 2.437255859, 2.246856689, 2.746002197, 3.349578857, 7.287231445, 12.14666748, 10.36282349, 8.472869873, 4.950195313, 2.867401123, 2.525726318, 2.525726318, 2.848846436, 3.337463379, 2.677490234, 2.138092041, 1.879302979, 2.550109863, 2.05657959, 2.032043457, 2.054870605, 4.11807251, 2.872894287, 6.761871338, 10.493927, 10.36282349, 9.369934082, 6.584899902, 4.009277344, 2.576416016, 2.603881836, 3.086181641, 2.831420898, 2.226623535, 1.373046875, 0.897644043, 2.095306396, 1.898376465, 1.467681885, 1.443572998, 4.374237061, 3.234222412, 5.930847168, 6.909118652, 10.36282349, 9.369934082, 8.234893799, 5.124145508, 2.878387451, 2.425537109, 1.960998535, 1.793334961, 1.469085693, 1.197967529, 1.511688232, 2.351837158, 2.346618652, 1.483093262, 1.483093262, 3.807373047, 5.777008057, 7.391235352, 7.094116211, 7.058288574, 11.32330322, 9.822540283, 4.878967285, 2.188262939, 1.893280029, 1.893280029, 1.735443115, 1.147827148, 1.17678833, 1.994689941, 2.351837158, 2.505126953, 1.290496826, 0.606750488, 4.933746338, 6.997406006, 6.859710693, 7.091033936, 5.957611084, 11.29049683, 9.822540283, 5.381378174, 3.909515381, 3.803283691, 3.803283691, 3.224212646, 2.320373535, 1.86114502, 2.206756592, 2.620727539, 1.413482666, 1.413482666, 0.471923828, 7.050689697, 6.724731445, 6.769805908, 6.05279541, 6.372589111, 11.64776611, 11.82061768, 4.575958252, 4.369750977, 2.679840088, 2.679840088, 2.778656006, 2.696472168, 2.321868896, 2.610229492, 2.620727539, 1.413482666, 1.413482666, 0.783569336, 8.638214111, 7.556427002, 6.929504395, 7.514282227, 10.13589478, 11.98605347, 10.09362793, 5.638519287, 4.380981445, 1.969024658, 1.46585083, 2.901489258, 2.696472168, 2.235870361, 2.304077148, 0.75958252, 0.624511719, 0.624511719, 0.783569336, 1.541992188, 1.63659668, 6.643920898, 6.929443359, 7.615905762, 6.990081787, 9.079650879, 11.2845459, 8.946014404, 3.808685303, 2.094543457, 1.826049805, 2.285003662, 2.901489258, 2.696472168, 2.235870361, 2.304077148, 0.596466064, 0.658111572, 0.658111572, 0.829620361, 1.541992188, 1.277984619, 5.330200195, 4.691070557, 5.728759766, 3.68447876, 5.536224365, 4.839691162, 6.892700195, 8.557678223, 8.458496094, 7.774810791, 2.492401123, 3.038482666, 3.038482666, 2.704986572, 1.595611572, 1.90637207, 0.499511719, 0.619567871, 0.658111572, 0.658111572, 0.827606201, 1.403076172, 1.277984619, 4.276000977, 3.331451416, 4.047485352, 3.106048584, 3.96697998, 3.358398438, 6.21182251, 8.557678223, 8.458496094, 7.774810791, 4.852111816, 4.852111816, 4.852111816, 2.141265869, 0.932678223, 1.179595947, 0.934265137, 1.042541504, 0.835601807, 0.646331787, 0.815124512, 1.43069458, 1.055358887, 6.578277588, 4.086639404, 2.976226807, 3.331451416, 2.89855957, 3.328063965, 3.713928223, 3.765014648, 7.919219971, 8.172821045, 8.41708374, 7.774810791, 4.852111816, 4.852111816, 4.852111816, 2.222412109, 0.466522217, 1.080596924, 0.934265137, 0.775939941, 0.669891357, 0.422912598, 0.951904297, 1.43069458, 0.863220215, 4.868804932, 4.149597168, 2.181121826, 1.339141846, 2.384490967, 2.410400391, 2.581787109, 3.996520996, 7.919219971, 8.172821045, 3.92288208, 5.853393555, 4.411437988, 4.411437988, 2.992279053, 2.222412109, 0.762451172, 1.376525879, 1.349578857, 0.672180176, 0.857574463, 0.450775146, 1.095489502, 1.267028809, 1.060791016, 4.820465088, 3.439361572, 1.980072021, 0.913604736, 2.460510254, 2.089263916, 2.135375977, 3.264160156, 8.384094238, 8.172821045, 3.580230713, 2.22354126, 2.926635742, 2.926635742, 2.970367432, 0.677032471, 0.762451172, 1.264770508, 1.237823486, 1.012451172, 0.991424561, 0.584625244, 1.095489502, 1.14151001, 1.267120361, 4.739379883, 3.309509277, 2.794372559, 2.326599121, 1.515319824, 1.925842285, 2.386230469, 3.137908936, 3.756988525, 7.056091309, 7.100769043, 3.594329834, 2.22354126, 2.440795898, 2.440795898, 2.645355225, 1.291412354, 1.193634033, 1.201843262, 0.913482666, 0.883453369, 0.984832764, 1.117431641, 1.295806885, 1.021240234, 1.033599854)), row.names = c(NA, 500L), class = "data.frame")

为此做出的不同选择:

#试一试

library(plotly)
x = R$lyr17_vm_vector_ruggedness
y = R$lyr17_vm_TRI
z = R$lyr17_veg_map_sp_holdout_probability.2

plot_ly(R, x = x, y = y, z = z,
    type = 'scatter3d',
    mode = 'line',
    opacity = 7)

在此处输入图像描述

#尝试 2

require(rgl)
with(R,plot3d(x,y,z,
          type = "s",
          opacity = 1,
          col = c("red","blue","green")))

在此处输入图像描述

#尝试 3

library(plot3D)
library(plot3Drgl)
with(R,scatter3D(x,y,z,
          ticktype="detailed",
          type= "s",
          pch=16,
          xlab="vector_ruggedness", 
          ylab="TRI",
          zlab="probabilidad", 
          main=""))
plotrgl(lighting = TRUE, smooth = TRUE, cex=2)

在此处输入图像描述

#尝试 4

library(lazyeval)
dens <- interp(x,y,z)
#Error in UseMethod("interp") : no applicable method for 'interp' applied to an object of
#class "c('double', 'numeric')
plot_ly(x = R$x, y = R$y, z = R$z) %>% add_surface()
#Error: Must supply `z` attribute

#尝试 5

with(R, MASS::kde2d(R$lyr17_vm_vector_ruggedness, 
                R$lyr17_vm_TRI,
                R$lyr17_veg_map_sp_holdout_probability.2,
                n=1000)) 
plot_ly(x = R$x, y = R$y, z = R$lyr17_veg_map_sp_holdout_probability.2) %>% add_surface()
Error: `z` must be a numeric matrix

--

我认为我在将矩阵返回到 z 时遇到问题。谢谢你帮助我

解决方案

在 R 社区做出回应。分享最后的情节:

在此处输入图像描述

标签: plotlyscatter-plotscatter3d

解决方案


推荐阅读