Title: Off-axes scatter() points unnecessarily saved to PDF when coloured · Issue #2488 · matplotlib/matplotlib · GitHub
Open Graph Title: Off-axes scatter() points unnecessarily saved to PDF when coloured · Issue #2488 · matplotlib/matplotlib
X Title: Off-axes scatter() points unnecessarily saved to PDF when coloured · Issue #2488 · matplotlib/matplotlib
Description: Scatter plotting a bunch of points while specifying the colour of each point, then changing the axes limits so none of the points are visible, and then saving the result to a PDF, results in a file just as big as if the points were all v...
Open Graph Description: Scatter plotting a bunch of points while specifying the colour of each point, then changing the axes limits so none of the points are visible, and then saving the result to a PDF, results in a file...
X Description: Scatter plotting a bunch of points while specifying the colour of each point, then changing the axes limits so none of the points are visible, and then saving the result to a PDF, results in a file...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/2488
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Off-axes scatter() points unnecessarily saved to PDF when coloured","articleBody":"Scatter plotting a bunch of points while specifying the colour of each point, then changing the axes limits so none of the points are visible, and then saving the result to a PDF, results in a file just as big as if the points were all visible within their default axes limits. This doesn't seem to happen if the colour arg isn't passed to `scatter()`. I haven't tried, but specifying other kinds of point specific attributes, like size, might also trigger the problem . Also, I haven't tried any of the other vector backends, but they may be affected as well.\n\nThis came out of #2423.\n\nExample code:\n\n``` python\nimport numpy as np\nx = np.random.random(20000)\ny = np.random.random(20000)\nc = np.random.random(20000)\n\nfigure()\nscatter(x, y)\npyplot.savefig('scatter.pdf')\nxlim(2, 3) # move axes away for empty plot\npyplot.savefig('scatter_empty.pdf')\n'''\nfile sizes in bytes:\nscatter.pdf: 324187\nscatter_empty.pdf: 6617\n'''\nfigure()\nscatter(x, y, c=c)\npyplot.savefig('scatter_color.pdf')\nxlim(2, 3) # move axes away for empty plot\npyplot.savefig('scatter_color_empty.pdf')\n'''\nfile sizes in bytes:\nscatter_color.pdf: 410722\nscatter_color_empty.pdf: 413541\n'''\n```\n","author":{"url":"https://github.com/mspacek","@type":"Person","name":"mspacek"},"datePublished":"2013-10-02T14:43:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/2488/matplotlib/issues/2488"}
| 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:2381af32-e515-1206-989d-59ebbe32d356 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BA2:1D90CC:28FB570:38F1EB7:6A4F56A2 |
| html-safe-nonce | b483f60919fd295da104d3cbdbdccc7a3ec3c95404c6ee5a340c779c7a94f440 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkEyOjFEOTBDQzoyOEZCNTcwOjM4RjFFQjc6NkE0RjU2QTIiLCJ2aXNpdG9yX2lkIjoiMzk2MDIwMTk1MTcwNzA5MjY0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 529d5fec549a6d9457037c82bf2aac1a8dad46cd8ac8dad7811e6d260df8adb5 |
| hovercard-subject-tag | issue:20398429 |
| 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/2488/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1da9807998a7195db3f033b1d440750d7b39198efe11a00ae4661a8618e0cf20/matplotlib/matplotlib/issues/2488 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1da9807998a7195db3f033b1d440750d7b39198efe11a00ae4661a8618e0cf20/matplotlib/matplotlib/issues/2488 |
| og:image:alt | Scatter plotting a bunch of points while specifying the colour of each point, then changing the axes limits so none of the points are visible, and then saving the result to a PDF, results in a file... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mspacek |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| 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 | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width