Title: [ENH]: directional antialiasing filter · Issue #29711 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: directional antialiasing filter · Issue #29711 · matplotlib/matplotlib
X Title: [ENH]: directional antialiasing filter · Issue #29711 · matplotlib/matplotlib
Description: Problem Currently, the antialiasing filter used by imshow() is applied both in the x and the y direction. There are cases where "image-like" data is highly sampled in one direction (requiring antialiasing) but not in the other, and also ...
Open Graph Description: Problem Currently, the antialiasing filter used by imshow() is applied both in the x and the y direction. There are cases where "image-like" data is highly sampled in one direction (requiring antia...
X Description: Problem Currently, the antialiasing filter used by imshow() is applied both in the x and the y direction. There are cases where "image-like" data is highly sampled in one direction (requi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29711
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: directional antialiasing filter","articleBody":"### Problem\n\nCurrently, the antialiasing filter used by imshow() is applied both in the x and the y direction. There are cases where \"image-like\" data is highly sampled in one direction (requiring antialiasing) but not in the other, and also has some nans; an example is a kymograph like subfigure 1c at https://www.nature.com/articles/s41467-017-01462-y/figures/1\n\nFor such data, the current default interpolation settings (antialiased + rgba (because *one* of the directions is oversampled) can yield not nice artefacts, in particular at the boundary between \"data\" and \"nan\":\n\n```python\nfrom pylab import *\n\nvals = np.full((50, 500), np.nan)\nfor i, row in enumerate(vals):\n n = 200 + np.random.randint(300)\n row[:n] = np.sin(np.arange(n) / 10 + i / 5) # make some fake data\naxs = figure(layout=\"constrained\", figsize=(10, 10)).subplots(\n 3, 3, subplot_kw={\"xticks\": [], \"yticks\": []})\nfor i, interpolation in enumerate([None, \"none\", \"antialiased\"]):\n for j, stage in enumerate([None, \"data\", \"rgba\"]):\n axs[i, j].text(0, 0, f\"{interpolation=}, {stage=}\", bbox={\"fc\": \"w\"})\n axs[i, j].imshow(vals.T, aspect=\"auto\", origin=\"lower\",\n interpolation=interpolation, interpolation_stage=stage)\nshow()\n```\n\n\nFor this specific dataset, the best settings currently available is probably to go back to interpolation=\"data\". But ideally, it would be nice if it was possible to have a separable antialiasing filter (I don't actually know if the current one is separable), so that one can apply it (here) only in the vertical direction (ideally in rgba space).\n\n### Proposed solution\n\n_No response_","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2025-03-06T11:49:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":17},"url":"https://github.com/29711/matplotlib/issues/29711"}
| 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:8c5ad043-1ec6-6c20-ce29-81a17579f785 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8D6:3F5325:61C54F:8C6BDB:6A55E7EC |
| html-safe-nonce | 7223c57e1af1b3bc0ab42193d1d9b3bb995be93f67cf1b86fcea932fd5687be3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEQ2OjNGNTMyNTo2MUM1NEY6OEM2QkRCOjZBNTVFN0VDIiwidmlzaXRvcl9pZCI6IjIxODIzMTMyOTYyMjg5MDI4OTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 812e8f6ea4d6ce0478b646c672599ecf27bb361a3e1f1336462cbb9a7aebc40f |
| hovercard-subject-tag | issue:2900187404 |
| 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/29711/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2e0377f0eb817a5b87f8fa8e9cd81f8419e2c7a622a80fc2140ee0814adbc719/matplotlib/matplotlib/issues/29711 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2e0377f0eb817a5b87f8fa8e9cd81f8419e2c7a622a80fc2140ee0814adbc719/matplotlib/matplotlib/issues/29711 |
| og:image:alt | Problem Currently, the antialiasing filter used by imshow() is applied both in the x and the y direction. There are cases where "image-like" data is highly sampled in one direction (requiring antia... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 | 3725c7f9b2a6e3a27ef57c5aed13428c0f65e045 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width