Skip to content

3D Scatter transparency not activated by marker.color or marker.line.color as well as line.color and errorbars alpha channel #3492

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 Jan 29, 2019 · 2 comments · Fixed by #3496
Assignees
Labels
bug something broken

Comments

@jonmmease
Copy link
Contributor

Originally reported in plotly/plotly.py#1416.

The alpha channel of rgba colors seems to be respected by scatter3d, but only if the opacity property is set to something less than 1.

CodePen: https://codepen.io/jonmmease/pen/OdRbdL

var trace1 = {
  x: [0, 1.1, 2.2], 
  y: [0, 1, 2], 
  z: [0, 1, 2], 
  mode: 'markers',
  marker: {
    size: 20,
    color: ['rgba(255, 0, 0, 0.9)',
            'rgba(255, 0, 0, 0.5)',
            'rgba(217, 0, 0, 0.1)'],
    line: {
    },
    opacity: 1.0
    // opacity: 0.99
  },
  type: 'scatter3d'
};

var data = [trace1];
var layout = {
      margin: {
        l: 0,
        r: 0,
        b: 0,
        t: 0
  }};
Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true});

With trace1.opacity: 1.0
newplot-3

With trace1.opacity: 0.99
newplot-4

Could the opacity<1 logic be activated automatically if marker.color includes rgba colors with alpha < 255? Or maybe just if there are any colors specified as rgba period.

@archmoj archmoj self-assigned this Jan 29, 2019
@archmoj archmoj added the bug something broken label Jan 29, 2019
@archmoj archmoj changed the title 3D Scatter transperency not activated by marker color alpha channel 3D Scatter transperency not activated by marker.color or marker.line.color as well as line.color and errorbars alpha channel Jan 29, 2019
@archmoj
Copy link
Contributor

archmoj commented Jan 29, 2019

It seems a similar issue existed with lines.
Here is a demo.

@archmoj archmoj changed the title 3D Scatter transperency not activated by marker.color or marker.line.color as well as line.color and errorbars alpha channel 3D Scatter transparency not activated by marker.color or marker.line.color as well as line.color and errorbars alpha channel Jan 29, 2019
@etpinard
Copy link
Contributor

I guess we could activate it for scalar values, but for array marker.color that's whole other story -> #3138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment