Title: Noninteger Bases in mathtext sqrt · Issue #8665 · matplotlib/matplotlib · GitHub
Open Graph Title: Noninteger Bases in mathtext sqrt · Issue #8665 · matplotlib/matplotlib
X Title: Noninteger Bases in mathtext sqrt · Issue #8665 · matplotlib/matplotlib
Description: Bug report Bug summary It appears that only integer sqrt bases are allowed by mathtext. The documentation does not list this limitation. Code for reproduction import matplotlib.pyplot as plt fig = plt.figure() axis = fig.add_subplot(1, 1...
Open Graph Description: Bug report Bug summary It appears that only integer sqrt bases are allowed by mathtext. The documentation does not list this limitation. Code for reproduction import matplotlib.pyplot as plt fig = ...
X Description: Bug report Bug summary It appears that only integer sqrt bases are allowed by mathtext. The documentation does not list this limitation. Code for reproduction import matplotlib.pyplot as plt fig = ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8665
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Noninteger Bases in mathtext sqrt","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\nIt appears that only integer sqrt bases are allowed by mathtext. The documentation does not list this limitation.\r\n\r\n**Code for reproduction**\r\n```\r\nimport matplotlib.pyplot as plt\r\n\r\nfig = plt.figure()\r\naxis = fig.add_subplot(1, 1, 1)\r\naxis.plot(1, 1, label=r'$\\sqrt[a]{{x}}$')\r\naxis.legend()\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n`mathtext.Parser.parse` raises a `ValueError`.\r\n\r\n**Expected outcome**\r\nThe [documentation](https://matplotlib.org/users/mathtext.html#radicals) states the following:\r\n\r\n\u003e Radicals can be produced with the \\sqrt[]{} command ... Any base can (optionally) be provided inside square brackets. Note that the base must be a simple expression, and can not contain layout commands such as fractions or sub/superscripts\r\n\r\nIn fact, it seems that only a (signed) integer literal is allowed. From `mathtext.Parser.__init__`:\r\n```\r\np.sqrt \u003c\u003c= Group(\r\n Suppress(Literal(r\"\\sqrt\"))\r\n - ((Optional(p.lbracket + p.int_literal + p.rbracket, default=None)\r\n + p.required_group)\r\n | Error(\"Expected \\sqrt{value}\"))\r\n )\r\n```\r\nIt would be convenient if other bases were allowed. If that change cannot be made (or in the meantime), I think the documentation should be updated.\r\n\r\n**Matplotlib version**\r\n * Operating System: Debian 9.0\r\n * Matplotlib Version: 2.0.0\r\n * Python Version: 3.5.3\r\n\r\nI believe I installed Python from the `python3.5` package in the `stretch` repository and Matplotlib from the `python3-matplotlib` package in the `stretch` repository, but I'm not sure.","author":{"url":"https://github.com/ben-e-whitney","@type":"Person","name":"ben-e-whitney"},"datePublished":"2017-05-25T23:18:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/8665/matplotlib/issues/8665"}
| 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:11ce419c-2ba6-8385-316a-53e1721fcfb0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9F0:156C3A:1A44D1:234C30:6A5185E6 |
| html-safe-nonce | 895c06f8c311ba58d6d735b9322c87c2aa119a0f59c666b2a8a74b17f4ae3d17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUYwOjE1NkMzQToxQTQ0RDE6MjM0QzMwOjZBNTE4NUU2IiwidmlzaXRvcl9pZCI6IjExODU4NzExOTQxMTAzOTU4NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3b4ba48f01307e5c17b851713b28327114235329b44fbc46eef0b08f5fbb8a66 |
| hovercard-subject-tag | issue:231485795 |
| 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/8665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/add5172e65ca156e7c3aa090e225b8cc8a371885f00bb2c12b0793a76e73754b/matplotlib/matplotlib/issues/8665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/add5172e65ca156e7c3aa090e225b8cc8a371885f00bb2c12b0793a76e73754b/matplotlib/matplotlib/issues/8665 |
| og:image:alt | Bug report Bug summary It appears that only integer sqrt bases are allowed by mathtext. The documentation does not list this limitation. Code for reproduction import matplotlib.pyplot as plt fig = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ben-e-whitney |
| 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 | cb77a7b8b06cd86c243be33fd8e7922d70a9d243 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width