{"action":"created","issue":{"url":"https://api.github.com/repos/rootpy/rootpy/issues/627","labels_url":"https://api.github.com/repos/rootpy/rootpy/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/rootpy/rootpy/issues/627/comments","events_url":"https://api.github.com/repos/rootpy/rootpy/issues/627/events","html_url":"https://github.com/rootpy/rootpy/issues/627","id":58212401,"number":627,"title":"Drawing histogram as a line","user":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars.githubusercontent.com/u/1213276?v=3","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-19T14:10:34Z","updated_at":"2015-02-22T12:09:13Z","closed_at":null,"body":"I am currently trying to think of ways to implement the 'drawing a histogram as a line' functionality to produce plots like these:\r\n![Image of target](https://twiki.cern.ch/twiki/pub/CMSPublic/PhysicsResultsTOP11013/combined_Cross_Leptons_Pt_log.png)\r\n\r\nI have a current example that uses root2matplotlib:\r\n![Image of current](https://raw.githubusercontent.com/BristolTopGroup/DailyPythonScripts/master/examples/plots/Bin_Centers.png)\r\nwith code available here: https://github.com/BristolTopGroup/DailyPythonScripts/blob/master/examples/Bin_Centers.py\r\n\r\nI was unable to find a way in the current implementation so I wanted to talk about a possible solution in order to make a pull request.\r\n\r\nMy current solution involves the use of pyplot.plot:\r\n```python\r\n#finebinned is the finebinned histogram shown above\r\ny = list(h_truth_finebinned.y())\r\nbin_edges = np.array(list(h_truth_finebinned.xedges()))\r\nbincenters = 0.5*(bin_edges[1:]+bin_edges[:-1])\r\n# ...\r\nplt.plot(bincenters, y, '-')\r\n```\r\n\r\nWhile it works, I don't think it is the best solution. Any ideas?\r\nHow would this be ported to root2matplotlib?\r\nWould it be enough to introduce a ```asline``` parameter to the ```root2matplotlib.hist``` function?"},"comment":{"url":"https://api.github.com/repos/rootpy/rootpy/issues/comments/75432519","html_url":"https://github.com/rootpy/rootpy/issues/627#issuecomment-75432519","issue_url":"https://api.github.com/repos/rootpy/rootpy/issues/627","id":75432519,"user":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars.githubusercontent.com/u/1213276?v=3","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T12:09:13Z","updated_at":"2015-02-22T12:09:13Z","body":"@ndawe thanks for the comment. So this is something that should be kept external to roopty if I understand correctly.\r\nI will try the graph option and then tidy up the example. Maybe instead of providing this functionality for root2matplotlib (quite specific) could I provide an example for rootpy?"}}