{"record":{"id":"7d6dd74674c061fd","repo":"plotly/plotly.js","slug":"ignoring-coloraxis-colorax-setting-as-it-is-li","errorCode":null,"errorMessage":"Ignoring coloraxis: ${colorAx} setting as it is linked to incompatible colorscales.","messagePattern":"Ignoring coloraxis: (.+?) setting as it is linked to incompatible colorscales\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/colorscale/defaults.js","lineNumber":63,"sourceCode":"\n    if(inTrace) {\n        var colorAxes = layout._colorAxes || {};\n        var colorAx = coerce(prefix + 'coloraxis');\n\n        if(colorAx) {\n            var colorbarVisuals = (\n                traceIs(parentContOut, 'contour') &&\n                Lib.nestedProperty(parentContOut, 'contours.coloring').get()\n            ) || 'heatmap';\n\n            var stash = colorAxes[colorAx];\n\n            if(stash) {\n                stash[2].push(thisFn);\n\n                if(stash[0] !== colorbarVisuals) {\n                    stash[0] = false;\n                    Lib.warn([\n                        'Ignoring coloraxis:', colorAx, 'setting',\n                        'as it is linked to incompatible colorscales.'\n                    ].join(' '));\n                }\n            } else {\n                // stash:\n                // - colorbar visual 'type'\n                // - colorbar options to help in Colorbar.draw\n                // - list of colorScaleDefaults wrapper functions\n                colorAxes[colorAx] = [colorbarVisuals, parentContOut, [thisFn]];\n            }\n            return;\n        }\n    }\n\n    var minIn = containerIn[cLetter + 'min'];\n    var maxIn = containerIn[cLetter + 'max'];\n    var validMinMax = isNumeric(minIn) && isNumeric(maxIn) && (minIn < maxIn);","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/components/colorscale/defaults.js#L45-L81","documentation":"When multiple traces share a layout coloraxis, plotly.js computes a shared colorbar; if the traces linked to that coloraxis carry incompatible colorscales (e.g. one sequential, one reversed or different ranges), the library warns and ignores the coloraxis setting rather than producing a misleading merged colorbar.","triggerScenarios":"Setting layout.coloraxis (or coloraxis2, ...) where traces bound to it have conflicting cmin/cmax, reversed scales, or different colorscale arrays; e.g. two scatter traces with marker.coloraxis='coloraxis' but one with colorscale 'Viridis' and another 'Hot' plus distinct ranges.","commonSituations":"Programmatically merging traces with independently chosen color scales; templates that set a shared coloraxis while data-driven traces override colorscale; using one coloraxis for both a continuous and a diverging-scale trace.","solutions":["Align the colorscale (and cmin/cmax) of every trace that references the shared coloraxis.","Split incompatible traces onto separate coloraxes (coloraxis, coloraxis2) so each has a coherent scale.","Remove per-trace colorscale overrides and rely on the layout.coloraxis definition.","Reversing: use a single direction consistently; avoid mixing reversed scales across linked traces.","Check which traces bind to the axis via their *_coloraxis attributes and audit them together."],"exampleFix":"// before\n{layout: {coloraxis: {colorscale: 'Viridis'}}, traces with scales: ['Hot', 'Viridis']}\n// after\n{layout: {coloraxis: {colorscale: 'Viridis'}, coloraxis2: {colorscale: 'Hot'}},\n traces: [{marker: {coloraxis: 'coloraxis'}}, {marker: {coloraxis: 'coloraxis2'}}]}","handlingStrategy":"validation","validationCode":"function coloraxesCompatible(traces, axId) {\n  const linked = traces.filter(t => (t.marker && t.marker.coloraxis) === axId || (t.line && t.line.coloraxis) === axId);\n  const scales = new Set(linked.map(t => JSON.stringify(t.marker && t.marker.colorscale)));\n  return scales.size <= 1;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every trace linked to one coloraxis the same colorscale and cmin/cmax.","Use distinct coloraxis ids (coloraxis, coloraxis2) for traces needing different scales.","Let layout.coloraxis own the scale; avoid per-trace overrides on linked traces.","Audit templates for coloraxis bindings when figures change shape."],"tags":["colorscale","coloraxis","configuration"],"backgroundTag":"incompatible-colorscale-config","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}