Skip to content

Error bars not scaled correctly in logarithmic 3D plots #2962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonmmease opened this issue Sep 1, 2018 · 0 comments
Closed

Error bars not scaled correctly in logarithmic 3D plots #2962

jonmmease opened this issue Sep 1, 2018 · 0 comments
Labels
bug something broken

Comments

@jonmmease
Copy link
Contributor

Plotly.js translation of plotly/plotly.py#1139 reported by @jdieg0

generating a Scatter plot with a logarithmic y axis and given error_y works fine whereas creating a similar plot with Scatter3d with error bars results in extremely large error bars. The proportions of the error bars in the 3D plot are correct if type='log' is omitted.

Codepen: https://codepen.io/anon/pen/YOZyQq

In scatter the error bars work as expected.

// ## Constants
var x = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9.]
var y = x.map(function() {return 0})
var z = [1.e+00, 1.e+01, 1.e+02, 1.e+03, 1.e+04,
         1.e+05, 1.e+06, 1.e+07, 1.e+08, 1.e+09]

var error_z = [3.e-01, 3.e+00, 3.e+01, 3.e+02, 3.e+03, 
               3.e+04, 3.e+05, 3.e+06, 3.e+07, 3.e+08]

// ## Scatter 2D
var scatter = {
  'type': 'scatter',
  'error_y': {'array': error_z,
              'type': 'data',
              'visible': true
             },
  'x': x,
  'y': z
}

var layout = {'yaxis': {'type': 'log', 'title': 'z'},
              'xaxis': {'title': 'x'},
              'width': 800,
              'height': 800};

var data = [ scatter ];

// ## Plot scatter 2D
Plotly.newPlot('myDiv', data, layout);

newplot-3

In scatter3d the errors bars grow very large

var scatter3d = {
  'type': 'scatter3d',
  'error_z': {'array': error_z,
              'type': 'data',
              'visible': true
             },
  'x': x,
  'y': y,
  'z': z
}

var data3d = [ scatter3d ];
var layout3d = {'scene': {'zaxis': {'type': 'log'}},
                'width': 800,
                'height': 800};

// ## Plot scatter 3D
Plotly.newPlot('myDiv', data3d, layout3d);

newplot-4

Perhaps error_z.type='data' is not implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants