{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/9736","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/9736/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/9736/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/9736/events","html_url":"https://github.com/matplotlib/matplotlib/pull/9736","id":272725031,"number":9736,"title":"Lockout new axis converters","user":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"labels":[{"id":154030536,"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/units","name":"units","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/25","html_url":"https://github.com/matplotlib/matplotlib/milestone/25","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/25/labels","id":2189521,"number":25,"title":"v2.2","description":"","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars3.githubusercontent.com/u/199813?v=4","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":917,"closed_issues":237,"state":"open","created_at":"2016-12-11T20:54:18Z","updated_at":"2017-12-28T10:20:05Z","due_on":"2018-01-30T08:00:00Z","closed_at":null},"comments":2,"created_at":"2017-11-09T21:09:54Z","updated_at":"2017-12-28T17:09:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/9736","html_url":"https://github.com/matplotlib/matplotlib/pull/9736","diff_url":"https://github.com/matplotlib/matplotlib/pull/9736.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/9736.patch"},"body":"<!--Thank you so much for your PR! To help us review, fill out the form\r\nto the best of your ability.  Please make use of the development guide at\r\nhttps://matplotlib.org/devdocs/devel/index.html\r\n\r\nFor help with git and github workflow, please see https://matplotlib.org/devel/gitwash/development_workflow.html\r\n\r\nPlease do not create the PR out of master, but out of a separate branch. -->\r\n\r\n<!--Provide a general summary of your changes in the title above, for\r\nexample \"Raises ValueError on Non-Numeric Input to set_xlim\".  Please avoid\r\nnon-descriptive titles such as \"Addresses issue #8576\".-->\r\n\r\n\r\n## PR Summary\r\n\r\nA script like:\r\n\r\n```python\r\n    base = datetime.datetime(2017, 1, 1, 0, 10, 0)\r\n    time = [base - datetime.timedelta(days=x) for x in range(0, 3)]\r\n    data = [0., 2., 4.]\r\n    fig, ax = plt.subplots()\r\n    ax.plot(time, data)\r\n    ax.plot(['a', 'b'], [1., 2.])\r\n```\r\n\r\nwould run and make a very non-sensical and mislabeled plot.  This now returns a `TypeError` if this is done.  \r\n\r\nNote that the following will *not* be caught, and will result in an ugly error that pops up all the time:\r\n\r\n```\r\n    dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)\r\nValueError: ordinal must be >= 1\r\n```\r\n\r\n```python\r\n    base = datetime.datetime(2017, 1, 1, 0, 10, 0)\r\n    time = [base - datetime.timedelta(days=x) for x in range(0, 3)]\r\n    data = [0., 2., 4.]\r\n    fig, ax = plt.subplots()\r\n    ax.plot(time, data)\r\n    ax.plot([0., 3.], [1., 2.])\r\n```\r\n\r\nThe problem here is that the `update_units` function also gets called by `set_xlim` and `set_ylim`, and if these are on auto it passes bare floats.  Maybe that can be fixed, but is a bigger project...\r\n\r\nSee #9713 \r\n\r\n<!--Please provide at least 1-2 sentences describing the pull request in\r\ndetail.  Why is this change required?  What problem does it solve?-->\r\n\r\n<!--If it fixes an open issue, please link to the issue here.-->\r\n\r\n## PR Checklist\r\n\r\n- [ ] Has Pytest style unit tests\r\n- [ ] Code is PEP 8 compliant\r\n- [ ] New features are documented, with examples if plot related\r\n- [ ] Documentation is sphinx and numpydoc compliant\r\n- [ ] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)\r\n- [ ] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way\r\n\r\n<!--We understand that PRs can sometimes be overwhelming, especially as the\r\nreviews start coming in.  Please let us know if the reviews are unclear or the\r\nrecommended next step seems overly demanding , or if you would like help in\r\naddressing a reviewer's comments.  And please ping us if you've been waiting\r\ntoo long to hear back on your PR.-->"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/354321817","html_url":"https://github.com/matplotlib/matplotlib/pull/9736#issuecomment-354321817","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/9736","id":354321817,"user":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"created_at":"2017-12-28T17:09:48Z","updated_at":"2017-12-28T17:09:48Z","author_association":"CONTRIBUTOR","body":"@dstansby Did you have a chance to look at #9776 which is probably what I think we should consider using?  I think this approach of locking an axis to a converter should be thought about seriously - and maybe by someone more experienced w/ the units code than me.  This all came up wrt datetime code and categorical code.  So, @tacaswell, @anntzer, @story645 should chime in on if this is a good protection to add or not.  "}}
{"actor":{"display_login":"jklymak"}}