Title: [Bug]: Table cell facecolor is not drawn when only some edges are visible · Issue #32656 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Table cell facecolor is not drawn when only some edges are visible · Issue #32656 · matplotlib/matplotlib
X Title: [Bug]: Table cell facecolor is not drawn when only some edges are visible · Issue #32656 · matplotlib/matplotlib
Description: Bug summary If a table cell's visible_edges is anything other than 'closed', the cell's facecolor is not drawn, or only partly. We can't combine cell colors with custom edges. This was also asked on Stack Overflow: https://stackoverflow....
Open Graph Description: Bug summary If a table cell's visible_edges is anything other than 'closed', the cell's facecolor is not drawn, or only partly. We can't combine cell colors with custom edges. This was also asked o...
X Description: Bug summary If a table cell's visible_edges is anything other than 'closed', the cell's facecolor is not drawn, or only partly. We can't combine cell colors with custom edges. T...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/32656
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Table cell facecolor is not drawn when only some edges are visible","articleBody":"### Bug summary\n\nIf a table cell's `visible_edges` is anything other than `'closed'`, the cell's facecolor is not drawn, or only partly. We can't combine cell colors with custom edges. This was also asked on Stack Overflow: https://stackoverflow.com/questions/52566037\n\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\n\nfig, axs = plt.subplots(1, 4, figsize=(11, 2))\nfor ax, edges in zip(axs, [\"closed\", \"horizontal\", \"open\", \"BLR\"]):\n ax.axis(\"off\")\n ax.table(cellText=[[\"a\", \"b\"], [\"c\", \"d\"]], loc=\"center\", edges=edges,\n cellColours=[[\"tab:red\", \"tab:green\"], [\"tab:blue\", \"tab:orange\"]])\n ax.set_title(edges)\nplt.show()\n```\n\n### Actual outcome\n\nOnly the `'closed'` table is colored. The `'horizontal'`, `'open'` and `'BLR'` tables show only their edges and text; the cell colors are missing or not complete.\n\n\u003cimg width=\"1100\" height=\"200\" alt=\"test0\" src=\"https://github.com/user-attachments/assets/869b18e0-804a-4aa2-bd9b-19241399c093\" />\n\n### Expected outcome\n\nAll four tables are colored, with only the requested edges drawn.\n\n\u003cimg width=\"1100\" height=\"200\" alt=\"test1\" src=\"https://github.com/user-attachments/assets/73739859-82ec-4c16-8529-540e8b15a059\" />\n\n\n### Additional information\n\n`Cell.get_path` (`lib/matplotlib/table.py`) builds one path that is used both to fill the face and to stroke the edges. A hidden edge becomes a `MOVETO`, which splits the path into one-segment pieces with no area, so there is nothing to fill. With `'open'`, every segment after the first is a `MOVETO`.\n\nA possible fix is to draw the face over the full rectangle and the visible edges in separate passes. In a `Table`, all faces should be drawn before all edges, so a neighbouring cell's face doesn't cover a shared visible edge.\n\nWorkaround: draw the table twice, once with `edges='closed'` and cell edgecolor `'none'` for the colours, and once with the desired edges and cell facecolor `'none'` for the lines.\n\n### Operating system\n\nmacOS 15 (Darwin 24.6.0)\n\n### Matplotlib Version\n\n3.12.0.dev\n\n### Matplotlib Backend\n\nAgg\n\n### Python version\n\n3.12.16\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npixi","author":{"url":"https://github.com/yuzie007","@type":"Person","name":"yuzie007"},"datePublished":"2026-11-23T18:06:01Z","url":"https://github.com/matplotlib/matplotlib/issues/32656"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:c84c1f5e-91fc-758e-8444-7e722333de28 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC26:20D4:7D6BBE:A843A9:6B064EE6 |
| html-safe-nonce | 45c46864d3d50785b19b2b15b2719ceb2d690f033006fd641e673c0d06bd57fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzI2OjIwRDQ6N0Q2QkJFOkE4NDNBOTo2QjA2NEVFNiIsInZpc2l0b3JfaWQiOiIxODAxODkyNjIzOTAxMTUwOTUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 48bbca35284f39e188af797d4bf2ee3e4c23d54ae8f06a44dca6357304d0794f |
| hovercard-subject-tag | issue:6565690464 |
| 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/32656/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d776859ce2e3b0b9ddbfc42d96efa3f993b2822ea92986cdb0c96ff6ed5bc66a/matplotlib/matplotlib/issues/32656 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d776859ce2e3b0b9ddbfc42d96efa3f993b2822ea92986cdb0c96ff6ed5bc66a/matplotlib/matplotlib/issues/32656 |
| og:image:alt | Bug summary If a table cell's visible_edges is anything other than 'closed', the cell's facecolor is not drawn, or only partly. We can't combine cell colors with custom edges. This was also asked o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yuzie007 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e |
| 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 | f1f9a08f7c769a37f1dfc18ad43d463c222a7eea |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width