{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/basemap/issues/309","repository_url":"https://api.github.com/repos/matplotlib/basemap","labels_url":"https://api.github.com/repos/matplotlib/basemap/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/basemap/issues/309/comments","events_url":"https://api.github.com/repos/matplotlib/basemap/issues/309/events","html_url":"https://github.com/matplotlib/basemap/issues/309","id":165237356,"number":309,"title":"nightshade() requires explicit ax argument in 1.0.8","user":{"login":"evertrol","id":735460,"avatar_url":"https://avatars.githubusercontent.com/u/735460?v=3","gravatar_id":"","url":"https://api.github.com/users/evertrol","html_url":"https://github.com/evertrol","followers_url":"https://api.github.com/users/evertrol/followers","following_url":"https://api.github.com/users/evertrol/following{/other_user}","gists_url":"https://api.github.com/users/evertrol/gists{/gist_id}","starred_url":"https://api.github.com/users/evertrol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evertrol/subscriptions","organizations_url":"https://api.github.com/users/evertrol/orgs","repos_url":"https://api.github.com/users/evertrol/repos","events_url":"https://api.github.com/users/evertrol/events{/privacy}","received_events_url":"https://api.github.com/users/evertrol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-13T04:58:25Z","updated_at":"2016-07-14T14:26:24Z","closed_at":null,"body":"After upgrading to current master from 1.0.7, I ran into an error with the following code:\r\n```python\r\nfrom datetime import datetime\r\nfrom mpl_toolkits.basemap import Basemap\r\nfrom matplotlib.figure import Figure\r\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\r\n                                                                                        \r\nfig = Figure()                                                                          \r\naxes = fig.add_subplot(111)                                                             \r\nmap = Basemap(projection='moll', lon_0=0, ax=axes)                                      \r\nmap.nightshade(datetime.now())                                                 \r\ncanvas = FigureCanvas(fig)                                                              \r\ncanvas.print_figure('test.png')                                                         \r\n```\r\nThis results in\r\n```python\r\nTraceback (most recent call last):\r\n  File \"testbasemap.py\", line 10, in <module>\r\n    map.nightshade(datetime.now())\r\n  File \"/usr/local/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py\", line 4668, in nightshade\r\n    CS.collections,c = self._cliplimb(ax,CS.collections)\r\n  File \"/usr/local/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py\", line 1804, in _cliplimb\r\n    if c not in ax.patches:\r\nAttributeError: 'NoneType' object has no attribute 'patches'\r\n```\r\n\r\nThis doesn't happen in 1.0.7.\r\n\r\nThe work-around is to use\r\n```python\r\nmap.nightshade(datetime.now(), ax=axes)                                                 \r\n```\r\n\r\nbut overall, this seems to be a regression bug of sorts.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/basemap/issues/comments/232681166","html_url":"https://github.com/matplotlib/basemap/issues/309#issuecomment-232681166","issue_url":"https://api.github.com/repos/matplotlib/basemap/issues/309","id":232681166,"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":"2016-07-14T14:26:24Z","updated_at":"2016-07-14T14:26:24Z","body":"Confirmed. Looks like I introduced a bug recently. I'll have a bugfix up in\na moment.\n\nOn Wed, Jul 13, 2016 at 12:58 AM, Evert Rol <notifications@github.com>\nwrote:\n\n> After upgrading to current master from 1.0.7, I ran into an error with the\n> following code:\n>\n> from datetime import datetimefrom mpl_toolkits.basemap import Basemapfrom matplotlib.figure import Figurefrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\n>\n> fig = Figure()\n> axes = fig.add_subplot(111)                                                             map = Basemap(projection='moll', lon_0=0, ax=axes)                                      map.nightshade(datetime.now())\n> canvas = FigureCanvas(fig)\n> canvas.print_figure('test.png')\n>\n> This results in\n>\n> Traceback (most recent call last):\n>   File \"testbasemap.py\", line 10, in <module>\n>     map.nightshade(datetime.now())\n>   File \"/usr/local/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py\", line 4668, in nightshade\n>     CS.collections,c = self._cliplimb(ax,CS.collections)\n>   File \"/usr/local/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py\", line 1804, in _cliplimb\n>     if c not in ax.patches:AttributeError: 'NoneType' object has no attribute 'patches'\n>\n> This doesn't happen in 1.0.7.\n>\n> The work-around is to use\n>\n> map.nightshade(datetime.now(), ax=axes)\n>\n> but overall, this seems to be a regression bug of sorts.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/matplotlib/basemap/issues/309>, or mute the thread\n> <https://github.com/notifications/unsubscribe/AARy-JjmtqIpcqjePPkRYMJILAmKaoeAks5qVHBygaJpZM4JLD_j>\n> .\n>\n"}}
{"actor":{"display_login":"WeatherGod"}}