# TypeError: rotation must be a number or string, not a list

- **ID:** `python/matplotlib-tick-label-rotation-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Passing a list of rotation values to set_xticklabels() or similar, which expects a single value for all labels or a list of labels with a scalar rotation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |

## Workarounds

1. **Use a scalar rotation value** (95% success)
   ```
   ax.set_xticklabels(labels, rotation=45)
   ```
2. **Apply rotation individually using a loop** (90% success)
   ```
   for label in ax.get_xticklabels(): label.set_rotation(45)
   ```

## Dead Ends

- **Using a tuple instead of a list** — Tuples are also not accepted; rotation must be a scalar. (80% fail)
- **Setting rotation via rcParams for all ticks** — This changes default but doesn't fix the TypeError from passing a list. (70% fail)
