# TypeError: float() argument must be a string or a real number, not 'datetime.datetime'

- **ID:** `python/matplotlib-date-converter-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Passing naive datetime objects directly to plot() without registering a date converter, or mixing datetime with numeric on the same axis.

## Version Compatibility

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

## Workarounds

1. **** (94% success)
   ```
   import matplotlib.dates as mdates
dates = mdates.date2num(dt_list)
ax.plot(dates, values)
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d'))
   ```
2. **** (90% success)
   ```
   import pandas as pd
pd.plotting.register_matplotlib_converters()
ax.plot(df['date'], df['value'])
   ```

## Dead Ends

- **** — Strings become categorical labels, destroying the time axis ordering and tick formatting. (75% fail)
- **** — Mixing converted and unconverted series still triggers the float() error on the unconverted one. (60% fail)
