{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/2516","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/2516/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/2516/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/2516/events","html_url":"https://github.com/matplotlib/matplotlib/issues/2516","id":20911677,"number":2516,"title":"bar() (and possibly other plots) should take an array of string labels for x axis","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/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/wishlist","name":"wishlist","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestones/proposed%20next%20point%20release%20(2.1)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"proposed next point release (2.1)","description":"Next feature release.\r\n\r\nBig ticket items:\r\n\r\n - MEP 22/27\r\n - traitlets","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":417,"closed_issues":240,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2015-11-07T15:42:47Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2013-10-12T14:21:53Z","updated_at":"2015-11-07T20:32:08Z","closed_at":"2015-04-12T03:22:38Z","body":"It's pretty common to have bar charts where the x axis is a set of string labels rather than numbers.  This can currently be done in pyplot with e.g.\r\n```\r\nbar([1,2,3],[4,3,6], align='center')\r\ngca().xaxis.set_ticks([1, 2, 3])\r\ngca().xaxis.set_ticklabels(['one', 'two', 'three'])\r\n```\r\nbut it would be much nicer to simply support\r\n```\r\nbar(['one', 'two', 'three'], [4,3,6])\r\n```\r\nSimilarly for `barh` and possibly some other plot types.\r\n\r\ncc: @alanedelman"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/154746603","html_url":"https://github.com/matplotlib/matplotlib/issues/2516#issuecomment-154746603","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/2516","id":154746603,"user":{"login":"yuschat","id":12863464,"avatar_url":"https://avatars.githubusercontent.com/u/12863464?v=3","gravatar_id":"","url":"https://api.github.com/users/yuschat","html_url":"https://github.com/yuschat","followers_url":"https://api.github.com/users/yuschat/followers","following_url":"https://api.github.com/users/yuschat/following{/other_user}","gists_url":"https://api.github.com/users/yuschat/gists{/gist_id}","starred_url":"https://api.github.com/users/yuschat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuschat/subscriptions","organizations_url":"https://api.github.com/users/yuschat/orgs","repos_url":"https://api.github.com/users/yuschat/repos","events_url":"https://api.github.com/users/yuschat/events{/privacy}","received_events_url":"https://api.github.com/users/yuschat/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T20:32:08Z","updated_at":"2015-11-07T20:32:08Z","body":"xticks can take care of the labeling problem associated with bar charts. see example below:\r\n\r\nimport matplotlib.pyplot as plt\r\nx=[1,2,3,4]\r\nlabels=['jan','feb','mar','apr']\r\ny=[40,70,30,54]\r\nplt.bar(x,y, align='center')\r\nplt.xticks(x, labels)\r\n\r\nOutput is shown below:\r\n![bar_chart](https://cloud.githubusercontent.com/assets/12863464/11017148/20cf5490-854b-11e5-87b5-03309b23b2a1.png)\r\n\r\n\r\n"}}