plotly/plotly.js · error

Attempted to group the bins of trace <traceOut.index> set on

Error message

Attempted to group the bins of trace <traceOut.index> set on a type:<axType> axis with bins on type:<binOpts.axType> axis.

What it means

Warning from fillBinOpts, the cross-trace binning harmonizer for histogram-like traces. Traces sharing a bingroup must bin on the same kind of axis; the code keys bin options by group and records the axis type (linear/log/date/category) of the first trace. When a later trace's axis type differs from the group's stored axType, the traces cannot share bin size/offset settings, so the trace is split onto a fallback group of its own and this warning explains the split.

Source

Thrown at src/traces/histogram/cross_trace_defaults.js:64

        // N.B. group traces that don't have a bingroup with themselves
        var fallbackGroupName = traceOut.uid + '__' + binDir;
        if(!groupName) groupName = fallbackGroupName;

        var axType = getAxisType(traceOut, binDir);
        var calendar = traceOut[binDir + 'calendar'] || '';
        var binOpts = allBinOpts[groupName];
        var needsNewItem = true;

        if(binOpts) {
            if(axType === binOpts.axType && calendar === binOpts.calendar) {
                needsNewItem = false;
                binOpts.traces.push(traceOut);
                binOpts.dirs.push(binDir);
            } else {
                groupName = fallbackGroupName;

                if(axType !== binOpts.axType) {
                    Lib.warn([
                        'Attempted to group the bins of trace', traceOut.index,
                        'set on a', 'type:' + axType, 'axis',
                        'with bins on', 'type:' + binOpts.axType, 'axis.'
                    ].join(' '));
                }
                if(calendar !== binOpts.calendar) {
                    // prohibit bingroup for traces using different calendar,
                    // there's probably a way to make this work, but skip for now
                    Lib.warn([
                        'Attempted to group the bins of trace', traceOut.index,
                        'set with a', calendar, 'calendar',
                        'with bins',
                        (binOpts.calendar ? 'on a ' + binOpts.calendar + ' calendar' : 'w/o a set calendar')
                    ].join(' '));
                }
            }
        }

View on GitHub (pinned to 1d090e0b5f)

Solutions

  1. Put traces meant to share bins on axes of the same type (e.g. all linear or all log).
  2. Remove the bingroup setting if the traces were not meant to be binned together.
  3. Check for accidental yaxis/xaxis type overrides ('log', 'date') on one trace of the group.
  4. Align axis type via layout (e.g. xaxis.type) before plotting the grouped histograms.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/traces/histogram/cross_trace_defaults.js:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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