我有一個基本的plot.ly具有三維指定的各種路徑的三維散點圖。在閱讀了三天的文檔之後,我仍然沒有找到一種方法來定義我的軸的滴答間隔。它似乎是基於我的數據自動生成它們,我不想要這些數據。實際上,我需要我的三個軸以1:1:1的比例,這是可能的嗎?是否可以手動設置plot.ly三維散點圖上的刻度和刻度?
<style>html, body { height: 100%; }</style>
<div id="myDiv" style="width: 100%; height: 100%"></div>
<!-- Latest compiled and minified plotly.js JavaScript -->
<script type="text/javascript" src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
var data = [
{
x: [-886, -719],
y: [-4785, -5192],
z: [527, 501],
type: 'scatter3d'
},
{
x: [-1782, -92],
y: [1740, -5172],
z: [18, 252],
type: 'scatter3d'
},
{
x: [3844, -450],
y: [35, -5185],
z: [20, 219],
type: 'scatter3d'
},
{
x: [2770, 761],
y: [2360, -5122],
z: [246, 96],
type: 'scatter3d'
},
{
x: [3800, 546],
y: [-3419, -5215],
z: [57, 311],
type: 'scatter3d'
},
{
x: [-340, 775],
y: [-3893, -5189],
z: [573, 135],
type: 'scatter3d'
},
{
x: [-3141, -41],
y: [3677, -5205],
z: [18, 383],
type: 'scatter3d'
},
{
x: [19, -546],
y: [261, -5181],
z: [74, 93],
type: 'scatter3d'
},
{
x: [3, 789],
y: [394, -5165],
z: [112, 421],
type: 'scatter3d'
}
];
var layout = {
// height: 700,
// width: 700,
xaxis: {
range: [-5000, 5000]
},
yaxis: {
range: [-5000, 5000]
}
};
Plotly.newPlot('myDiv', data, layout);
</script>
代碼演示:https://rocket-league-replays.github.io/3d-hitmaps/