{"action":"opened","issue":{"url":"https://api.github.com/repos/SciTools/cartopy/issues/1097","repository_url":"https://api.github.com/repos/SciTools/cartopy","labels_url":"https://api.github.com/repos/SciTools/cartopy/issues/1097/labels{/name}","comments_url":"https://api.github.com/repos/SciTools/cartopy/issues/1097/comments","events_url":"https://api.github.com/repos/SciTools/cartopy/issues/1097/events","html_url":"https://github.com/SciTools/cartopy/issues/1097","id":345272032,"node_id":"MDU6SXNzdWUzNDUyNzIwMzI=","number":1097,"title":"Error specifying center long for Mercator projection and extents on Python 3.6","user":{"login":"acrosby","id":865212,"node_id":"MDQ6VXNlcjg2NTIxMg==","avatar_url":"https://avatars1.githubusercontent.com/u/865212?v=4","gravatar_id":"","url":"https://api.github.com/users/acrosby","html_url":"https://github.com/acrosby","followers_url":"https://api.github.com/users/acrosby/followers","following_url":"https://api.github.com/users/acrosby/following{/other_user}","gists_url":"https://api.github.com/users/acrosby/gists{/gist_id}","starred_url":"https://api.github.com/users/acrosby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrosby/subscriptions","organizations_url":"https://api.github.com/users/acrosby/orgs","repos_url":"https://api.github.com/users/acrosby/repos","events_url":"https://api.github.com/users/acrosby/events{/privacy}","received_events_url":"https://api.github.com/users/acrosby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-27T15:34:17Z","updated_at":"2018-07-27T15:34:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description\r\n<!-- Please provide a general introduction to the issue/proposal. -->\r\nThe following code works in Python 2 but fails in Python 3. The commented lines appear to work OK however, so it is really only a minor problem.\r\n\r\n\r\n<!--\r\nIf you are reporting a bug, attach the *entire* traceback from Python.\r\n\r\nIf you are proposing an enhancement/new feature, provide links to related articles, reference examples, etc.\r\n\r\nIf you are asking a question, please ask on StackOverflow and use the cartopy tag. All cartopy\r\nquestions on StackOverflow can be found at https://stackoverflow.com/questions/tagged/cartopy\r\n-->\r\n\r\n#### Code to reproduce\r\n```python\r\nimport cartopy.crs as ccrs\r\nimport cartopy\r\nimport matplotlib.pyplot as plt\r\n\r\ncm_lon=51.15\r\nmaplimits = [-26., 128.3, -73.3, -31.1]\r\n\r\nax = plt.axes(projection=ccrs.Mercator(central_longitude=cm_lon))\r\n#ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=cm_lon))\r\n#ax = plt.axes(projection=ccrs.Mercator())\r\nax.set_extent([maplimits[0], maplimits[1], maplimits[2], maplimits[3]])\r\nplt.show()\r\n```\r\n\r\n#### Traceback \r\n\r\n```\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n~/miniconda2/envs/xesmf/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py in set_extent(self, extents, crs)\r\n    686             # the projection extents, so try and give a better error message.\r\n--> 687             x1, y1, x2, y2 = projected.bounds\r\n    688         except ValueError:\r\n\r\nValueError: not enough values to unpack (expected 4, got 0)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-1-47cd62a8a14f> in <module>()\r\n     12 ax.add_feature(cartopy.feature.LAND, color='gray')\r\n     13 ax.coastlines(resolution='10m', linewidth=0.25)\r\n---> 14 ax.set_extent([maplimits[0], maplimits[1], maplimits[2], maplimits[3]])\r\n     15 plt.show()\r\n\r\n~/miniconda2/envs/xesmf/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py in set_extent(self, extents, crs)\r\n    692                    'y_limits=[{ylim[0]}, {ylim[1]}]).')\r\n    693             raise ValueError(msg.format(xlim=self.projection.x_limits,\r\n--> 694                                         ylim=self.projection.y_limits))\r\n    695         self.set_xlim([x1, x2])\r\n    696         self.set_ylim([y1, y2])\r\n\r\nValueError: Failed to determine the required bounds in projection coordinates. Check that the values provided are within the valid range (x_limits=[-20037508.342789244, -20037508.34278924], y_limits=[-15496570.739723722, 18764656.23138057]).\r\n\r\n```\r\n\r\n"}}
{"actor":{"display_login":"acrosby"}}