# TypeError: 'figsize' is an invalid keyword argument for <class 'matplotlib.figure.Figure'>

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

## Root Cause

Passing figsize directly to plt.figure() is correct, but if user mistakenly passes it to a subplot function like plt.subplot() or plt.subplots(), it raises a TypeError because those functions don't accept figsize.

## Version Compatibility

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

## Workarounds

1. **Pass figsize only to plt.figure() or plt.subplots()** (95% success)
   ```
   fig, ax = plt.subplots(figsize=(8,6))
   ```
2. **Use set_size_inches() on the figure object after creation** (90% success)
   ```
   fig = plt.figure(); fig.set_size_inches(8,6)
   ```

## Dead Ends

- **Using figsize as a positional argument** — figsize must be a keyword argument; positional passing will be misinterpreted. (80% fail)
- **Setting plt.rcParams['figure.figsize'] before creating figure** — This changes default figure size, but the error is about passing figsize to wrong function. (70% fail)
