Title: urls are ignored when rendering a QuadMesh to SVG · Issue #12392 · matplotlib/matplotlib · GitHub
Open Graph Title: urls are ignored when rendering a QuadMesh to SVG · Issue #12392 · matplotlib/matplotlib
X Title: urls are ignored when rendering a QuadMesh to SVG · Issue #12392 · matplotlib/matplotlib
Description: Bug report Bug summary I've passed urls arg in the Axes.pcolormesh() method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing. I traced it to the RendererBase.draw_quad_mesh() method which passes [None] as the url...
Open Graph Description: Bug report Bug summary I've passed urls arg in the Axes.pcolormesh() method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing. I traced it to the RendererBase.draw_quad_mesh...
X Description: Bug report Bug summary I've passed urls arg in the Axes.pcolormesh() method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing. I traced it to the RendererBase.draw_quad_...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12392
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"urls are ignored when rendering a QuadMesh to SVG","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nI've passed `urls` arg in the `Axes.pcolormesh()` method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing.\r\n\r\nI traced it to the `RendererBase.draw_quad_mesh()` method which passes `[None]` as the urls argument to `self.draw_path_collection()`.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nnan = np.nan\r\ndata = np.array([[nan, 4, nan], [2, 7, 5], [nan, 8, nan]])\r\nlinks = np.array([[nan, 'http://abc.com/', nan],\r\n ['http://cnn.com/', 'http://nbc.com/', 'http://cbs.com/'],\r\n [nan, 'http://nytimes.com',]])\r\n\r\nfig = plt.figure()\r\nax = plt.gca()\r\nmesh = ax.pcolormesh(data, urls=links)\r\nfig.savefig('/tmp/test_links.svg')\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\n$ fgrep http /tmp/test_link.svg \r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"\u003e\r\n\u003c!-- Created with matplotlib (http://matplotlib.org/) --\u003e\r\n\u003csvg height=\"288pt\" version=\"1.1\" viewBox=\"0 0 432 288\" width=\"432pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\u003e\r\n```\r\n\r\n**Expected outcome**\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\r\n\r\nThe URLs are inserted into the quadmesh \u003cg\u003e element like this:\r\n```\r\n\u003cg id=\"QuadMesh_1\"\u003e\r\n \u003ca xlink:href=\"url\"\u003e \u003cpath\u003e /* the path */ \u003c/path\u003e \u003c/a\u003e\r\n \u003ca xlink:href=\"url\"\u003e \u003cpath\u003e /* the path */ \u003c/path\u003e \u003c/a\u003e\r\n\u003c/g\u003e\r\n```\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Linux \r\n * Matplotlib version: 2.2.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): module://ipykernel.pylab.backend_inline, but SVG is what I care about\r\n * Python version: 3.5.3\r\n * Jupyter version (if applicable): 4.4.0\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\nmatplotlib is installed in a virtualenv with pip.","author":{"url":"https://github.com/pingyeh","@type":"Person","name":"pingyeh"},"datePublished":"2018-10-03T21:53:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/12392/matplotlib/issues/12392"}
| 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:a11a575c-af47-9af4-0569-1e6abea4c1b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D426:3499D7:328DAF:44EE71:6A568EAC |
| html-safe-nonce | cdcaeece55abbcc6a53bf0266b971e9c60d115a0a5496d7a3d1d4ad09096ca1b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDI2OjM0OTlENzozMjhEQUY6NDRFRTcxOjZBNTY4RUFDIiwidmlzaXRvcl9pZCI6IjM3ODQzNzY3ODgxNTcxMDc4ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 499346d442ac709b8ea31925ca63fa7061a0d8e5e58624d875a1504c23554359 |
| hovercard-subject-tag | issue:366544693 |
| 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/12392/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7a2aba70da8226ef48ead9dd9a8b3698640dda78f30be04dd59122c21bdd5ce/matplotlib/matplotlib/issues/12392 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7a2aba70da8226ef48ead9dd9a8b3698640dda78f30be04dd59122c21bdd5ce/matplotlib/matplotlib/issues/12392 |
| og:image:alt | Bug report Bug summary I've passed urls arg in the Axes.pcolormesh() method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing. I traced it to the RendererBase.draw_quad_mesh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pingyeh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38 |
| 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 | 78af172a48a2056810bb627ffa684003e4f9a5ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width