Title: [ENH]: Could matplotlib be used to draw diagrams (flow charts, mindmap, system architecture, etc) like TikZ for LaTeX? · Issue #30794 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Could matplotlib be used to draw diagrams (flow charts, mindmap, system architecture, etc) like TikZ for LaTeX? · Issue #30794 · matplotlib/matplotlib
X Title: [ENH]: Could matplotlib be used to draw diagrams (flow charts, mindmap, system architecture, etc) like TikZ for LaTeX? · Issue #30794 · matplotlib/matplotlib
Description: Problem We have been looking for a diagram creator, similar to TikZ but more user-friendly in Pythonic style. Here is an official example for matplotlib: Matplotlib for Making Diagrams, but could the following issues be solved? Draw an e...
Open Graph Description: Problem We have been looking for a diagram creator, similar to TikZ but more user-friendly in Pythonic style. Here is an official example for matplotlib: Matplotlib for Making Diagrams, but could t...
X Description: Problem We have been looking for a diagram creator, similar to TikZ but more user-friendly in Pythonic style. Here is an official example for matplotlib: Matplotlib for Making Diagrams, but could t...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30794
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Could matplotlib be used to draw diagrams (flow charts, mindmap, system architecture, etc) like TikZ for LaTeX?","articleBody":"### Problem\n\nWe have been looking for a diagram creator, similar to TikZ but more user-friendly in Pythonic style.\n\nHere is an official example for matplotlib: [Matplotlib for Making Diagrams](https://matplotlib.org/matplotblog/posts/mpl-for-making-diagrams/), but could the following issues be solved?\n\n- Draw an element with its **absolute size and position**, and easily get those attributes so you don't need to compute\n\n- Auto-resize the canvas without pre-sizing to display all elements\n\n- \"Combine shapes\" that allows to manipulate multiple elements for scaling, offsetting, copying... (similar function in PowerPoint or Visio)\n\n### Proposed solution\n\nSomething like:\n\n```python\nfrom matplotlib import pyplot as plt\nfrom matplotlib import diagrams as mad # new\nfrom matplotlib.diagrams import Rectangle # new: inherit from `matplotlib.patches.Rectangle` but with more attributes\n\nfig, cv = mad.canvas(unit=\"cm\") # something like plt.subplots() but create a auto-resize canvas\n\nrect = Rectangle((0, 0), 1.0, 2.0, figure=fig) # a 1cm x 2cm rectancle placed at the origin\ncirc = cv.draw(\n (2, 0),\n shape=\"circle\",\n radius=0.5,\n color=\"green\",\n linestyle=\"dashed\",\n linewidth=2,\n) # another method to draw a circle placed at (2cm, 0cm)\n\n# get the attributes\ncv.arrow(\n rect.east, # will return (1.0, 1.0) like `.east` in TikZ\n circ.north, # will return (2.0, 0.5) like `.north` in TikZ\n)\n# if you prefer the style for `matplotlib.axes.Axes.arrow`\n# the above method could be overloaded as:\n# cv.arrow(\n# x=rect.east.x,\n# y=rect.east.y,\n# dx=circ.north.x - rect.east.x,\n# dy=circ.north.y - rect.east.y,\n# )\n\n# \"Combine shapes\"\ngroup = cv.combine() # a matplotlib instance or even another canvas!\n...\ngroup.place((5, 3), scale=0.5) # place \u0026 scale\n\nfig.savefig(\"1.pdf\", transparent=True, bbox_inches=\"tight\")\nfig.show()\n```","author":{"url":"https://github.com/Saltsmart","@type":"Person","name":"Saltsmart"},"datePublished":"2025-11-27T09:16:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/30794/matplotlib/issues/30794"}
| 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:5d652d3c-97f7-cbed-76bd-283e05782b1b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83D4:18E6A9:555B55:70A407:6A52D7CF |
| html-safe-nonce | 6faf0ef1a2285887a70f316c05acb115eae4e984252b01686deed2c1e6aa0a56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0Q0OjE4RTZBOTo1NTVCNTU6NzBBNDA3OjZBNTJEN0NGIiwidmlzaXRvcl9pZCI6IjQ1NTMzMTkwMDgwOTE0Mjg4MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 86b1de0fadb20f0c182bc6733b730e5c592c6ab36b3fa0be3c2888244e8c9fee |
| hovercard-subject-tag | issue:3670542542 |
| 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/30794/issue_layout |
| twitter:image | https://opengraph.githubassets.com/384458f05f01b4d931a79da7367dba98c28cfdd9411c5471219818211bff7c24/matplotlib/matplotlib/issues/30794 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/384458f05f01b4d931a79da7367dba98c28cfdd9411c5471219818211bff7c24/matplotlib/matplotlib/issues/30794 |
| og:image:alt | Problem We have been looking for a diagram creator, similar to TikZ but more user-friendly in Pythonic style. Here is an official example for matplotlib: Matplotlib for Making Diagrams, but could t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Saltsmart |
| 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