# RuntimeError: In set_size: Could not set the fontsize (or) Image size of 100000x80000 pixels is too large. It must be less than 2^16 in each direction.

- **ID:** `python/matplotlib-figure-too-large`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Saving a figure with figsize*dpi exceeding 65535 pixels in either dimension, which exceeds the PNG/JPEG limits enforced by the backend.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   fig.set_size_inches(20, 16)
fig.savefig('out.png', dpi=150)  # 3000x2400 px
   ```
2. **** (92% success)
   ```
   fig.savefig('out.pdf')  # no pixel limit for vector backends
   ```

## Dead Ends

- **** — Higher dpi worsens the pixel count and triggers the same limit. (92% fail)
- **** — 'raw' is not a valid format for savefig; the size limit still applies to raster backends. (85% fail)
