Is it possible to limit the x,y,z axis of a 3d-Surface plot?

I don’t know if i’m doing something wrong but every time i change the range of the axes it just stays the same.
The Code:

Plotly.d3.csv('data.csv', function(err, rows){
                function unpack(rows, key) {
                    return rows.map(function(row) { return row[key]; });
                }
                
                var z_data=[ ]
                for(i=0;i<24;i++){
                    z_data.push(unpack(rows,i));
                }

                var data = [{
                    z: z_data,
                    type: 'surface'
                }];
                
                var layout = {
                    title: 'Test: Sensor-Werte: MPU6050',
		    xaxis: {range: [-100,100]},
		    zaxis: {range: [100, 100]}, 
                   width: 1200,
                    height: 1200,
                };
                Plotly.newPlot('myDiv', data, layout);
                });

The current Output
image

Hi @plotly_question welcome to the forum! For a 3d plot you need to specify the layout.scene.xaxis.range, you did not use the scene here (the code which you wrote has a correct syntax since layout.xaxis is used for 2d plots). See for example https://plot.ly/javascript/3d-axes/#range-of-axes

1 Like