# UserWarning: FixedFormatter should only be used together with FixedLocator

- **ID:** `python/matplotlib-tick-label-overlap`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Calling set_xticklabels() with a FixedFormatter while the locator is still an auto locator, causing labels to be mismatched with tick positions.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   import numpy as np
ax.set_xticks(np.arange(len(labels)))
ax.set_xticklabels(labels, rotation=45, ha='right')
   ```
2. **** (90% success)
   ```
   from matplotlib.ticker import FuncFormatter
ax.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: labels[int(x)] if 0 <= int(x) < len(labels) else ''))
   ```

## Dead Ends

- **** — Labels may still be placed at wrong positions, producing a misleading plot. (70% fail)
- **** — The mismatch remains; the warning is informational about the locator/formatter pair. (85% fail)
