Title: [ENH]: Support parallel plotting · Issue #30420 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Support parallel plotting · Issue #30420 · matplotlib/matplotlib
X Title: [ENH]: Support parallel plotting · Issue #30420 · matplotlib/matplotlib
Description: Problem When plotting multiple plots at once, matplotlib will sometimes nondeterministically fail, when plt.rcParams["text.usetex"] = True is used. A cache directory is created in the MPLCONFIGDIR, which is used globally. Cache files are...
Open Graph Description: Problem When plotting multiple plots at once, matplotlib will sometimes nondeterministically fail, when plt.rcParams["text.usetex"] = True is used. A cache directory is created in the MPLCONFIGDIR,...
X Description: Problem When plotting multiple plots at once, matplotlib will sometimes nondeterministically fail, when plt.rcParams["text.usetex"] = True is used. A cache directory is created in the MPL...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30420
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Support parallel plotting","articleBody":"### Problem\n\nWhen plotting multiple plots at once, matplotlib will sometimes nondeterministically fail, when `plt.rcParams[\"text.usetex\"] = True` is used. A cache directory is created in the MPLCONFIGDIR, which is used globally. Cache files are created with random file names and if independent processes create or delete them, while one tries to access them, matplotlib will fail.\n\nThere was a [workaround ](https://github.com/matplotlib/matplotlib/issues/30392#issuecomment-3155555309) by resetting the MPLCONFIGDIR variable and then reloading matplotlib, but that solution has its own problems now.\n\n### Proposed solution\n\nTwo solutions come to mind:\n\n1. make it possible to change the location of the cache dir after matplotlib was imported, this would require a user to know to change it, if they want to plot in parallel. \n2. Remove the conflict by making the cache files unique globally, for example by numbering them sequentially or adding the process id of the owning process.\n\nI would also like to add, that a significant boost in execution speed can be achieved, if the cache dir is created in RAM instead of flash or hard disk memory. See this example [here](https://github.com/matplotlib/matplotlib/issues/7776#issuecomment-368281112). Perhaps it would be wise to also move the cache dir to `/tmp` if it exists on a given system.\n\nThe most sensible thing to do imho, would be to move the cache dir to a place where it cannot interfere with any other process, meaning solution 2. And that location should be a RAM disk, if available.","author":{"url":"https://github.com/neutronst4r","@type":"Person","name":"neutronst4r"},"datePublished":"2025-08-13T11:45:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/30420/matplotlib/issues/30420"}
| 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:6ac406e1-a03c-0e68-ecf8-7c79333b1d26 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9634:13DB1B:A6248E:DF46D2:6A51A096 |
| html-safe-nonce | 84d0f2cd63257562ba0a5435ff687af8c04d6b32a4de7b168271bbe7c17c534a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjM0OjEzREIxQjpBNjI0OEU6REY0NkQyOjZBNTFBMDk2IiwidmlzaXRvcl9pZCI6IjU3NTY5Nzg2NDkyODc5OTE0NDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b791f690bcda2ab159b3d857f199f2a9f5f8a29485fea74b3425e85c20fa40c5 |
| hovercard-subject-tag | issue:3318129388 |
| 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/30420/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa4c14ae6f5839e0805e0ee0f0c617ac87265fe25f9d022019150c2f0fe5fbf7/matplotlib/matplotlib/issues/30420 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa4c14ae6f5839e0805e0ee0f0c617ac87265fe25f9d022019150c2f0fe5fbf7/matplotlib/matplotlib/issues/30420 |
| og:image:alt | Problem When plotting multiple plots at once, matplotlib will sometimes nondeterministically fail, when plt.rcParams["text.usetex"] = True is used. A cache directory is created in the MPLCONFIGDIR,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | neutronst4r |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width