Plotly.js: Error bars not inheriting color

Created on 3 Jan 2019  路  4Comments  路  Source: plotly/plotly.js

Here I'm only setting the marker color per trace, but the error bars are getting their color seemingly from colorway:

image

bug

All 4 comments

@nicolaskruchten Could you please test this. I think a similar issue may be existed with 2D error bars?

Plotly.newPlot(gd, {
  "data": [
    {
      "x": [0, 1, 2, 3, 4],
      "y": [1, 2, 4, 8, 16],
      "marker": {
        "width": 5
      },
      "type": "scatter",
      "mode": "markers+lines",
      "error_y": {
        "type": "sqrt"
      }
    },
    {
      "x": [1, 2, 3, 4, 5],
      "y": [1, 2, 4, 8, 16],
      "marker": {
        "color": "green",
        "width": 5
      },
      "type": "scatter",
      "mode": "markers+lines",
      "error_y": {
        "type": "sqrt"
      }
    }
  ]
});

Huh, that's unexpected. So I guess my question is: is this reasonable? error bars iterate through colorway on their own, independently of the markers they're attached to??

(BTW in future, a CodePen is easier for me to look at than just code, as otherwise I have to go find an environment to run it in!)

Sounds UNreasonable to me. Unless error bar color is going to be some other color, like black error bars on bar charts, it should be inherited from an explicit color in the trace. Might be some annoying logic considering all the different possible attributes to inherit from - marker color, line color (especially if there IS no marker), marker line color - but I believe it should be clear what the desired outcome is in any given case. Surprised we didn鈥檛 already do it this way, but better late than never!

OK so we should upgrade this issue to fix this in both 2d and 3d. I think in bars it's tricky because if they were the same color as the bars the lower one would be invisible...

Was this page helpful?
0 / 5 - 0 ratings