Title: [Bug]: 3D wireframe plot error output (3.11.0rc2) · Issue #31742 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: 3D wireframe plot error output (3.11.0rc2) · Issue #31742 · matplotlib/matplotlib
X Title: [Bug]: 3D wireframe plot error output (3.11.0rc2) · Issue #31742 · matplotlib/matplotlib
Description: Bug summary 3d Wireframe plot error at v.3.11.0rc2 with experimental input data from text file, but at 3.10.8 does not. Code for reproduction import os, sys, re import math as m import numpy as np import pandas as pd import matplotlib.py...
Open Graph Description: Bug summary 3d Wireframe plot error at v.3.11.0rc2 with experimental input data from text file, but at 3.10.8 does not. Code for reproduction import os, sys, re import math as m import numpy as np ...
X Description: Bug summary 3d Wireframe plot error at v.3.11.0rc2 with experimental input data from text file, but at 3.10.8 does not. Code for reproduction import os, sys, re import math as m import numpy as np ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31742
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: 3D wireframe plot error output (3.11.0rc2)","articleBody":"### Bug summary\n\n3d Wireframe plot error at v.3.11.0rc2 with experimental input data from text file, but at 3.10.8 does not.\n\n### Code for reproduction\n\n```Python\nimport os, sys, re\nimport math as m\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LogNorm\nimport matplotlib\n\n#fpath = r'C:\\Users\\User\\Desktop\\Научная работа\\Программы\\МОДЭС\\test freq\\W-35 FISH LOW TEMP 5 TO 60 STEP 3.TXT'\n#fpath = r'C:\\Users\\User\\Desktop\\Научная работа\\Программы\\МОДЭС\\test freq\\P273 NZR -100 TO +200 STEP 5.TXT'\n#fpath = r'C:\\Users\\User\\Desktop\\Научная работа\\Программы\\МОДЭС\\test freq\\NUMBER3 CL 0_03 -150 TO 120 STEP 5.TXT'\nfpath = r'D:\\Рабочий стол\\\\МОДЭС\\test freq\\test NUMBER3 CL 0_03 -150 TO 120 STEP 5.TXT'\n\nfpath = os.path.normpath(fpath) \nfname = os.path.split(fpath)[1]\n\n# data search\npattern = r\"[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][-+]?\\d+)?\"\n\nheadlines = 0\nwith open(fpath, 'r', encoding='ansi') as (f):\n # head lines\n while not re.match(pattern, f.readline().split()[0]):\n headlines += 1\n \ndata = pd.read_table(fpath, sep='\\t', skiprows=headlines, \n names=['freq', 'temp', \"eps_real\", \"eps_imag\",\"sigma\"], \n encoding = \"ISO-8859-1\") \n # (из-за ошибки utf-8 encoding)\n\n# str to float\ntry:\n data.applymap(lambda x: float(x))\nexcept:\n # pandas ver. \u003e 2.1.0, map instead applymap !\n data.map(lambda x: float(x))\n \ndata.sort_values(by=[\"temp\", \"freq\"], ascending=[True, False], \n inplace=True)\n\n#----------------------------------------\n\nfig, axes = plt.subplots(2,2, figsize=(24, 16), dpi = 400,\n subplot_kw={\"projection\": \"3d\"})\n\n# test 3d data\n\nx1 = np.linspace(-5, 5, 10)\ny1 = np.linspace(-5, 5, 10)\nX1, Y1 = np.meshgrid(x1, y1)\nZ1 = np.sin(np.sqrt(X1**2 + Y1**2))\n\n#data from file\n\ny = data.temp.unique()\ny_len = len(y)\n\nfr = data.loc[data['freq'] == data['freq'][0]]\nx_len = (fr).index[1]\n\nx = (data['freq'].values)[0:x_len]\n\nz = data['eps_imag'].values\n\ncolormap = 'coolwarm' #, \nlog_norm = LogNorm(vmin=0.1, vmax=z.max())\n\n\nax = axes[0,0]\nax.set_xlabel(\"Freq\")\nax.set_ylabel(\"Temp\")\nax.set_zlabel(\"Eps\")\nax.plot_wireframe(X1, Y1, Z1, cmap= colormap, norm =log_norm)\nax.set_title(\"3d test data\")\n\n\n\nax = axes[0,1]\nX, Y = np.meshgrid(x, y) \nZ = np.reshape(z, (y_len, x_len))\nax.set_xlabel(\"Freq\")\nax.set_ylabel(\"Temp\")\nax.set_zlabel(\"Eps\")\nax.plot_wireframe(X, Y, Z, cmap= colormap, norm =log_norm)\nax.set_title(\"3d file data\")\n\n\n\nax = axes[1,0]\ny = np.maximum(y, 0)\nax.set_title(\"file data y \u003e= 0\")\nax.set_xlabel(\"Freq\")\nax.set_ylabel(\"Temp\")\nax.set_zlabel(\"Eps\")\nX, Y = np.meshgrid(x, y) \nZ = np.reshape(z, (y_len, x_len))\nax.plot_wireframe(X, Y, Z, cmap= colormap, norm =log_norm)\n\naxes[1,1].remove()\n```\n\n### Actual outcome\n\n3.10.8 output :\n\n\u003cimg width=\"6425\" height=\"5093\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f7b8852b-2223-40a0-9d58-234fcc791210\" /\u003e\n\n\n3.11.0rc2 output (sin(√(x² + y²) only)\n\n\u003cimg width=\"6426\" height=\"5092\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/80618630-7fac-4ff1-bc8c-d351e2feac26\" /\u003e\n\n\n3.11rc2 output (all plots)\n\n[3d wireframe plot test output.txt](https://github.com/user-attachments/files/28193508/3d.wireframe.plot.test.output.txt)\n\n### Expected outcome\n\nwithout errors :)\n\n\u003cimg width=\"6425\" height=\"5093\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/ea34b73b-3712-4f2c-affa-3300770bef85\" /\u003e\n\n### Additional information\n\nI created this test example to observe an issue\n\nI tried 3d Wireframe plot at v. 3.11.0rc2 with experimental data from text file, but I got an error. My knowledge does not allow me to understand what is the matter :(\n\nThe input data file is a experimental Eps values versus frequency and temperature. \n[test NUMBER3 CL 0_03 -150 TO 120 STEP 5.TXT](https://github.com/user-attachments/files/28193680/test.NUMBER3.CL.0_03.-150.TO.120.STEP.5.TXT)\n\nI tried the same example with 3.10.8 version + test 3d shape [sin(√(x² + y²))], and i got correct 3d plots\n\nI use Spider IDE v6.1.4 and venv for package different versions\n\n### Operating system\n\nWindows 11\n\n### Matplotlib Version\n\n3.10.8 / 3.11.0rc2\n\n### Matplotlib Backend\n\nmodule://matplotlib_inline.backend_inline\n\n### Python version\n\n3.14.2\n\n### Jupyter version\n\nno\n\n### Installation\n\npip","author":{"url":"https://github.com/mrARGJ","@type":"Person","name":"mrARGJ"},"datePublished":"2026-05-24T14:15:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/31742/matplotlib/issues/31742"}
| 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:f80ca7cf-26f2-1177-24c6-31577bc7b48d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D00C:3D88FD:BB1E6:FECDF:6A532C43 |
| html-safe-nonce | 1c607b30d6a08ddaf4ccdf308e6f6baca8e660e47aa4003d71bd514bcea7d0c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDBDOjNEODhGRDpCQjFFNjpGRUNERjo2QTUzMkM0MyIsInZpc2l0b3JfaWQiOiIyNjcxMzk2NTUwOTYyNTIzMjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0dc55ff933ada7c3a0ca942441db17dfeb6870102e3dacf3839e730d3d147481 |
| hovercard-subject-tag | issue:4511870570 |
| 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/31742/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2bdcd4aaf9963b015ec7cabcd3bd015fe81f9245b34153f56845fd49d13ef3ba/matplotlib/matplotlib/issues/31742 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2bdcd4aaf9963b015ec7cabcd3bd015fe81f9245b34153f56845fd49d13ef3ba/matplotlib/matplotlib/issues/31742 |
| og:image:alt | Bug summary 3d Wireframe plot error at v.3.11.0rc2 with experimental input data from text file, but at 3.10.8 does not. Code for reproduction import os, sys, re import math as m import numpy as np ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mrARGJ |
| 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