{"action":"closed","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/11655","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/11655/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/11655/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/11655/events","html_url":"https://github.com/matplotlib/matplotlib/issues/11655","id":341210073,"node_id":"MDU6SXNzdWUzNDEyMTAwNzM=","number":11655,"title":"Sequential boxplot call edits xticklabels and xlim attributes","user":{"login":"qmarcou","id":18257721,"node_id":"MDQ6VXNlcjE4MjU3NzIx","avatar_url":"https://avatars0.githubusercontent.com/u/18257721?v=4","gravatar_id":"","url":"https://api.github.com/users/qmarcou","html_url":"https://github.com/qmarcou","followers_url":"https://api.github.com/users/qmarcou/followers","following_url":"https://api.github.com/users/qmarcou/following{/other_user}","gists_url":"https://api.github.com/users/qmarcou/gists{/gist_id}","starred_url":"https://api.github.com/users/qmarcou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qmarcou/subscriptions","organizations_url":"https://api.github.com/users/qmarcou/orgs","repos_url":"https://api.github.com/users/qmarcou/repos","events_url":"https://api.github.com/users/qmarcou/events{/privacy}","received_events_url":"https://api.github.com/users/qmarcou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-14T05:13:56Z","updated_at":"2018-07-14T14:58:17Z","closed_at":"2018-07-14T14:58:16Z","author_association":"NONE","body":"<!--To help us understand and resolve your issue, please fill out the form to the best of your ability.-->\r\n<!--You can feel free to delete the sections that do not apply.-->\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\nI have tried to make sequential calls to boxplot to create a line plot with a boxplot (instead of error bar as my data is clearly not normally distributed) at each x position. I was surprise to see that only the last boxplot is visible at the end. It seems that each call to boxplot edits the xlabel and change the xlim attribute of the concerned axis. \r\n<!--A short 1-2 sentences that succinctly describes the bug-->\r\n\r\n**Code for reproduction**\r\n\r\n<!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required-->\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfig,ax = plt.subplots(1,1)\r\nax.set_xlim(0,3) #Set xlim before to show that the xlim is changed\r\nax.boxplot([1,2,3,4,5,6],positions=[1])\r\nax.boxplot([1,2,3,4,5,6],positions=[2])\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n xlim have been changed and only boxplot at position 2 is visible:\r\n![image](https://user-images.githubusercontent.com/18257721/42721124-b48bb4b0-8702-11e8-8360-adf81edcd2dd.png)\r\n\r\n\r\n\r\nUpon moving the `ax.set_xlim(0,3)` line after the second boxplot creation:\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfig,ax = plt.subplots(1,1)\r\nax.boxplot([1,2,3,4,5,6],positions=[1])\r\nax.boxplot([1,2,3,4,5,6],positions=[2])\r\nax.set_xlim(0,3) #Set xlim after to show that xticklabel has been messed with\r\nplt.show()\r\nax.get_xticklabels() #Check the number of ticklabel objects present\r\n```\r\n one obtains:\r\nConsole output: `<a list of 1 Text xticklabel objects>`\r\nPlot :\r\n![image](https://user-images.githubusercontent.com/18257721/42721119-6f8d53c8-8702-11e8-9089-45caaad9b189.png)\r\n\r\n The label '1' of the first boxplot is missing, showing that the xticklabel has been messed with upon creation of the second boxplot:\r\n\r\n\r\n<!--The output produced by the above code, which may be a screenshot, console output, etc.-->\r\n\r\n\r\n**Expected outcome**\r\nThe expected outcome is the one produced by the following code:\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfig,ax = plt.subplots(1,1)\r\nax.boxplot([[1,2,3,4,5,6],[1,2,3,4,5,6]],positions=[1,2])\r\nax.set_xlim(0,3) #Set xlim before to show that the xlim is changed\r\nplt.show()\r\nax.get_xticklabels() #Check the number of ticklabel objects present\r\n```\r\nConsole output: `<a list of 2 Text xticklabel objects>`\r\nObtained plot:\r\n![image](https://user-images.githubusercontent.com/18257721/42721111-42fa2f0c-8702-11e8-826c-0a929434e5ad.png)\r\n\r\n<!--A description of the expected outcome from the code snippet-->\r\n<!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on-->\r\n\r\n**Matplotlib version**\r\n<!--Please specify your platform and versions of the relevant libraries you are using:-->\r\n  * Operating system: Ubuntu 18.04\r\n  * Matplotlib version: 2.2.2 (initially noticed on 1.5.3)\r\n  * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg or module://ipykernel.pylab.backend_inline\r\n  * Python version: 2.7.15\r\n\r\n\r\n<!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda-->\r\n<!--If you installed from conda, please specify which channel you used if not the default-->\r\n\r\n"}}
{"actor":{"display_login":"jklymak"}}