Title: fig.savefig gives OverflowError for high DPI's · Issue #19325 · matplotlib/matplotlib · GitHub
Open Graph Title: fig.savefig gives OverflowError for high DPI's · Issue #19325 · matplotlib/matplotlib
X Title: fig.savefig gives OverflowError for high DPI's · Issue #19325 · matplotlib/matplotlib
Description: Bug report Even with short timeseries, fig.savefig() throws an OverflowError for high dpi's. The example below uses 'Agg' with a significantly increased chunksize, yet it still throws an error for dpis > 250. import numpy as np import ma...
Open Graph Description: Bug report Even with short timeseries, fig.savefig() throws an OverflowError for high dpi's. The example below uses 'Agg' with a significantly increased chunksize, yet it still throws an error for ...
X Description: Bug report Even with short timeseries, fig.savefig() throws an OverflowError for high dpi's. The example below uses 'Agg' with a significantly increased chunksize, yet it still throws a...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19325
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fig.savefig gives OverflowError for high DPI's","articleBody":"### Bug report\r\n\r\nEven with short timeseries, `fig.savefig()` throws an `OverflowError` for high dpi's. \r\nThe example below uses `'Agg'` with a significantly increased `chunksize`, yet it still throws an error for dpis \u003e 250.\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\n\r\nmatplotlib.use('Agg')\r\nmatplotlib.rcParams['agg.path.chunksize'] = 20000000\r\n\r\nx = np.linspace(0, 100, 100000)\r\ny = np.random.randint(1, 100, 100000)\r\n\r\nfig = plt.figure()\r\nplt.plot(x, y)\r\n\r\ntry:\r\n fig.savefig('Figure.png', format='png')\r\n print('Successfully plotted without dpi')\r\nexcept Exception as e:\r\n print(e)\r\ntry:\r\n fig.savefig('Figure.png', format='png', dpi=500)\r\n print('Successfully plotted with high dpi')\r\nexcept Exception as e:\r\n print(e)\r\n```\r\nThe output here is:\r\n```python\r\nSuccessfully plotted without dpi\r\nExceeded cell block limit (set 'agg.path.chunksize' rcparam)\r\n\r\nProcess finished with exit code 0\r\n```\r\nwhereas I expected both to be successfully plotted, given that the chunksize OverflowError should only show when the number of plots exceeds the chunksize. \r\n\r\n\r\n**Matplotlib version**\r\n * Operating system: Windows 10\r\n * Matplotlib version: 3.3.3\r\n * Matplotlib backend: agg\r\n * Python version: 3..9.1\r\n * Other libraries: NumPy 1.19.4\r\n * Everything is installed with pip","author":{"url":"https://github.com/nielsuit227","@type":"Person","name":"nielsuit227"},"datePublished":"2021-01-20T11:29:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/19325/matplotlib/issues/19325"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8f6b0afc-9f22-4178-e51d-3565d2556100 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D55E:1CB906:35093:471BF:6A52D7BA |
| html-safe-nonce | cd23a4301138872663a06f4f2a604bfbff2ef35860d528dd00b1ec2ada5925c3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTVFOjFDQjkwNjozNTA5Mzo0NzFCRjo2QTUyRDdCQSIsInZpc2l0b3JfaWQiOiI0NzA0MzE3MjM3NzQxNDEwMjM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2d36168fd033d620cb71caab1cf64449d18468d5bd7dd6a4afc05eaab123424a |
| hovercard-subject-tag | issue:789894870 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/19325/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74257c3abb81d24c0a5762bc46397c20155dd58c57bef4bd8294c59976c32c75/matplotlib/matplotlib/issues/19325 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74257c3abb81d24c0a5762bc46397c20155dd58c57bef4bd8294c59976c32c75/matplotlib/matplotlib/issues/19325 |
| og:image:alt | Bug report Even with short timeseries, fig.savefig() throws an OverflowError for high dpi's. The example below uses 'Agg' with a significantly increased chunksize, yet it still throws an error for ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nielsuit227 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width