{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5205","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5205/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5205/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5205/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5205","id":110287112,"number":5205,"title":"pcolor does not handle non-array C data","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/API%20consistency","name":"API consistency","color":"000000"},{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/Difficulty:%20Easy","name":"Difficulty: Easy","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/20","html_url":"https://github.com/matplotlib/matplotlib/milestones/next%20bug%20fix%20release%20(2.0.1)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/20/labels","id":1306895,"number":20,"title":"next bug fix release (2.0.1)","description":"","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2015-09-15T17:47:44Z","updated_at":"2015-10-07T18:26:29Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-10-07T18:26:29Z","updated_at":"2015-10-07T18:36:12Z","closed_at":null,"body":"reported via https://github.com/VisTrails/VisTrails/issues/1132\r\n\r\nmay be a regression from 1.3 series, reported against 1.4.3, verified against master.  Not sure what last version it work on was.\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndef func3(x, ):\r\n    return (1 - x/2 + x**5 + y**3) * np.exp(-x**2 - y**2)\r\n\r\n\r\n# make these smaller to increase the resolution\r\ndx, dy = 0.05, 0.05\r\n\r\nx = np.arange(-3.0, 3.0001, dx)\r\ny = np.arange(-3.0, 3.0001, dy)\r\nX, Y = np.meshgrid(x, y)\r\n\r\nZ = func3(X, Y)\r\n\r\n# fails\r\nplt.pcolor(X, Y, list(Z))\r\n# plt.pcolor(X, Y, Z)  # works\r\n```"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/146287949","html_url":"https://github.com/matplotlib/matplotlib/issues/5205#issuecomment-146287949","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5205","id":146287949,"user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T18:36:12Z","updated_at":"2015-10-07T18:36:12Z","body":"Problem is in lib/matplotlib/axes/_axes.py:4969 in _pcolorargs(). It\nassumes that the C argument has the .shape attribute.\n```\n        if len(args) == 1:\n            C = args[0]\n            numRows, numCols = C.shape\n            if allmatch:\n                X, Y = np.meshgrid(np.arange(numCols), np.arange(numRows))\n            else:\n                X, Y = np.meshgrid(np.arange(numCols + 1),\n                                   np.arange(numRows + 1))\n            return X, Y, C\n\n        if len(args) == 3:\n            X, Y, C = args\n            numRows, numCols = C.shape\n        else:\n            raise TypeError(\n                'Illegal arguments to %s; see help(%s)' % (funcname,\nfuncname))\n```\n\nShould be pretty straight-forward to just slap on a `C = np.asanyarray(C)`\nbefore trying to access its shape.\n\nOn Wed, Oct 7, 2015 at 2:26 PM, Thomas A Caswell <notifications@github.com>\nwrote:\n\n> reported via VisTrails/VisTrails#1132\n> <https://github.com/VisTrails/VisTrails/issues/1132>\n>\n> may be a regression from 1.3 series.\n>\n> import matplotlib.pyplot as pltimport numpy as np\n> def func3(x, ):\n>     return (1 - x/2 + x**5 + y**3) * np.exp(-x**2 - y**2)\n>\n> # make these smaller to increase the resolution\n> dx, dy = 0.05, 0.05\n>\n> x = np.arange(-3.0, 3.0001, dx)\n> y = np.arange(-3.0, 3.0001, dy)\n> X, Y = np.meshgrid(x, y)\n>\n> Z = func3(X, Y)\n> # fails\n> plt.pcolor(X, Y, list(Z))# plt.pcolor(X, Y, Z)  # works\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/matplotlib/matplotlib/issues/5205>.\n>\n"}}