{"action":"opened","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8665","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8665/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8665/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8665/events","html_url":"https://github.com/matplotlib/matplotlib/issues/8665","id":231485795,"number":8665,"title":"Noninteger Bases in mathtext sqrt","user":{"login":"ben-e-whitney","id":5350974,"avatar_url":"https://avatars1.githubusercontent.com/u/5350974?v=3","gravatar_id":"","url":"https://api.github.com/users/ben-e-whitney","html_url":"https://github.com/ben-e-whitney","followers_url":"https://api.github.com/users/ben-e-whitney/followers","following_url":"https://api.github.com/users/ben-e-whitney/following{/other_user}","gists_url":"https://api.github.com/users/ben-e-whitney/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-e-whitney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-e-whitney/subscriptions","organizations_url":"https://api.github.com/users/ben-e-whitney/orgs","repos_url":"https://api.github.com/users/ben-e-whitney/repos","events_url":"https://api.github.com/users/ben-e-whitney/events{/privacy}","received_events_url":"https://api.github.com/users/ben-e-whitney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-25T23:18:50Z","updated_at":"2017-05-25T23:18:50Z","closed_at":null,"body":"### 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> 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          <<= 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."}}
{"actor":{"display_login":"ben-e-whitney"}}