# RuntimeError: 图像尺寸 100000x80000 像素过大。每个方向必须小于 2^16。

- **ID:** `python/matplotlib-figure-too-large`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

保存图形时 figsize*dpi 在任一维度超过 65535 像素，超出后端对 PNG/JPEG 的限制。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

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

## 无效尝试

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