plotly/plotly.js · warning

fixedrange was specified as false for axis <axName2> but was

Error message

fixedrange was specified as false for axis <axName2> but was overridden because another axis in its constraint group has fixedrange true

What it means

Within a constraint group (axes linked via scaleanchor/constraint or grid grouping), all axes are scaled together, so one axis having fixedrange: true forces every axis in the group to be fixed. If another axis in the group explicitly declared fixedrange: false, plotly.js warns that this explicit setting is overridden and sets fixedrange: true on it.

Source

Thrown at src/plots/cartesian/constraints.js:60

            for(axId in group) {
                layoutOut[id2name(axId)][stashAttr] = group;
            }
        }
    }
    stash(matchGroups, '_matchGroup');

    // If any axis in a constraint group is fixedrange, they all get fixed
    // This covers matches axes, as they're now in the constraintgroup too
    // and have not yet been removed (if the group is *only* matching)
    for(i = 0; i < constraintGroups.length; i++) {
        group = constraintGroups[i];
        for(axId in group) {
            axOut = layoutOut[id2name(axId)];
            if(axOut.fixedrange) {
                for(var axId2 in group) {
                    var axName2 = id2name(axId2);
                    if((layoutIn[axName2] || {}).fixedrange === false) {
                        Lib.warn(
                            'fixedrange was specified as false for axis ' +
                            axName2 + ' but was overridden because another ' +
                            'axis in its constraint group has fixedrange true'
                        );
                    }
                    layoutOut[axName2].fixedrange = true;
                }
                break;
            }
        }
    }

    // remove constraint groups that simply duplicate match groups
    i = 0;
    while(i < constraintGroups.length) {
        group = constraintGroups[i];
        for(axId in group) {
            axOut = layoutOut[id2name(axId)];

View on GitHub (pinned to 1d090e0b5f)

Solutions

  1. Remove fixedrange: false from axes in groups that contain a fixedrange: true member.
  2. Set fixedrange: true consistently on all axes in the constraint group.
  3. Move the axis out of the constraint group (drop scaleanchor/constraint) if it needs independent zoom.

Example fix

// before
layout.xaxis.fixedrange = true;
layout.xaxis2 = {scaleanchor: 'x', fixedrange: false};
// after
layout.xaxis.fixedrange = true;
layout.xaxis2 = {scaleanchor: 'x', fixedrange: true};
Defensive patterns

Strategy: validation

Validate before calling

function checkConstraintGroupFixedrange(layout, groupAxes) {
  const anyFixed = groupAxes.some(a => (layout[a] || {}).fixedrange === true);
  if (anyFixed) {
    groupAxes.forEach(a => {
      if ((layout[a] || {}).fixedrange === false) throw new Error(`${a} has fixedrange:false in a group with a fixed axis`);
    });
  }
}
checkConstraintGroupFixedrange(layout, ['xaxis', 'xaxis2']);

Type guard

const conflictsWithFixedGroup = (layout, a, group) => (layout[a] || {}).fixedrange === false && group.some(x => (layout[x] || {}).fixedrange === true);

Prevention

When it happens

Trigger: Configuring axis A with fixedrange: true and a sibling axis B in the same constraint/scaleanchor group with fixedrange: false, e.g. layout.xaxis2 = {scaleanchor: 'x', fixedrange: false} while xaxis has fixedrange: true.

Common situations: Zoom-locking a group with one fixed axis while individually toggling zoom on members; templated layouts where fixedrange: false is set explicitly by a theme/template on all axes.

Related errors


AI-assisted analysis of plotly/plotly.js@1d090e0b5f (2026-09-02). Data as JSON: /api/errors/1d6e2f7ed14b527e. Report an issue: GitHub.