如何在R中的3d散点图中获得正确的ticklabs?

时间:2016-08-17 06:44:22

标签: r plot scatter3d

请看这个例子。查看y轴。那里的数据只有两个级别:12。但是在该轴上绘制的6个刻度线。我怎么能解决这个问题。 x轴存在同样的问题。

数据

   extra group ID
1    0.7     1  1
2   -1.6     1  2
3   -0.2     1  3
4   -1.2     1  4
5   -0.1     1  5
6    3.4     1  6
7    3.7     1  7
8    0.8     1  8
9    0.0     1  9
10   2.0     1 10
11   1.9     2  1
12   0.8     2  2
13   1.1     2  3
14   0.1     2  4
15  -0.1     2  5
16   4.4     2  6
17   5.5     2  7
18   1.6     2  8
19   4.6     2  9
20   3.4     2 10

脚本

require('mise')
require('scatterplot3d')
mise()  # clear the workspace

# example data
print(sleep)

# plot it
scatterplot3d(x=sleep$ID,
              x.ticklabs=levels(sleep$ID),
              y=sleep$group,
              y.ticklabs=levels(sleep$group),
              z=sleep$extra)

结果

enter image description here

1 个答案:

答案 0 :(得分:1)

这个怎么样:

SensorData

enter image description here