GitHub PullRequestEvent at 2014-03-16 06:25:59
Repository: squarify
Actor: sinhrks
Payload: {"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/laserson/squarify/pulls/1","id":13610195,"html_url":"https://github.com/laserson/squarify/pull/1","diff_url":"https://github.com/laserson/squarify/pull/1.diff","patch_url":"https://github.com/laserson/squarify/pull/1.patch","issue_url":"https://api.github.com/repos/laserson/squarify/issues/1","number":1,"state":"open","title":"add plot method using matplotlib","user":{"login":"sinhrks","id":1696302,"avatar_url":"https://gravatar.com/avatar/22f56e55955b9aa693081ed5dc6400ae?d=https%3A%2F%2Fidenticons.github.com%2Ff2439b6ccc865e5ffadb34e6dc64302a.png&r=x","gravatar_id":"22f56e55955b9aa693081ed5dc6400ae","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"body":"Added `plot` method using matplotlib. Matplotlib is imported in the `plot` method and it should not affect to dependencies.\r\n\r\n*Usage Example:*\r\n```\r\nimport squarify\r\nimport matplotlib.pyplot as plt\r\nfrom numpy.random import rand\r\n\r\nfig, axes = plt.subplots(2, 3, figsize=(14, 8))\r\nplt.subplots_adjust(top=0.95, bottom=0.05, left=0.05, right=0.95, hspace=0.35)\r\n\r\nsq = 8\r\n\r\ndef random_colors(n):\r\n    return zip(rand(n), rand(n), rand(n))\r\n\r\nlabels = ['Sq{0}'.format(i) for i in range(sq)]\r\n\r\naxes[0, 0].set_title('Default')\r\nsquarify.plot(rand(sq), ax=axes[0, 0])\r\n\r\naxes[0, 1].set_title('Specify single color')\r\nsquarify.plot(rand(sq), color='r', ax=axes[0, 1])\r\n\r\naxes[0, 2].set_title('Specify each colors')\r\nsquarify.plot(rand(sq), color=random_colors(sq), ax=axes[0, 2])\r\n\r\naxes[1, 0].set_title('Specify labels')\r\nsquarify.plot(rand(sq), label=labels, ax=axes[1, 0])\r\n\r\nsizes = rand(sq)\r\nvalues = ['{0:0.2f}'.format(s) for s in sizes]\r\naxes[1, 1].set_title('Specify values')\r\nsquarify.plot(sizes, value=values, ax=axes[1, 1])\r\n\r\naxes[1, 2].set_title('Specify labels and values')\r\nsquarify.plot(sizes, label=labels, value=values, ax=axes[1, 2])\r\nplt.show()\r\n```\r\n\r\n*Output:*\r\n![squarify_plot](https://f.cloud.github.com/assets/1696302/2430332/23b4e2a8-acd3-11e3-871b-52ec45a764b9.png)","created_at":"2014-03-16T06:25:58Z","updated_at":"2014-03-16T06:25:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laserson/squarify/pulls/1/commits","review_comments_url":"https://api.github.com/repos/laserson/squarify/pulls/1/comments","review_comment_url":"https://api.github.com/repos/laserson/squarify/pulls/comments/{number}","comments_url":"https://api.github.com/repos/laserson/squarify/issues/1/comments","statuses_url":"https://api.github.com/repos/laserson/squarify/statuses/df041b8143558c0bf122239fca4d4251cbfed298","head":{"label":"sinhrks:plot_pr","ref":"plot_pr","sha":"df041b8143558c0bf122239fca4d4251cbfed298","user":{"login":"sinhrks","id":1696302,"avatar_url":"https://gravatar.com/avatar/22f56e55955b9aa693081ed5dc6400ae?d=https%3A%2F%2Fidenticons.github.com%2Ff2439b6ccc865e5ffadb34e6dc64302a.png&r=x","gravatar_id":"22f56e55955b9aa693081ed5dc6400ae","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"repo":{"id":17791313,"name":"squarify","full_name":"sinhrks/squarify","owner":{"login":"sinhrks","id":1696302,"avatar_url":"https://gravatar.com/avatar/22f56e55955b9aa693081ed5dc6400ae?d=https%3A%2F%2Fidenticons.github.com%2Ff2439b6ccc865e5ffadb34e6dc64302a.png&r=x","gravatar_id":"22f56e55955b9aa693081ed5dc6400ae","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sinhrks/squarify","description":"Pure Python implementation of the squarify treemap layout algorithm","fork":true,"url":"https://api.github.com/repos/sinhrks/squarify","forks_url":"https://api.github.com/repos/sinhrks/squarify/forks","keys_url":"https://api.github.com/repos/sinhrks/squarify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sinhrks/squarify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sinhrks/squarify/teams","hooks_url":"https://api.github.com/repos/sinhrks/squarify/hooks","issue_events_url":"https://api.github.com/repos/sinhrks/squarify/issues/events{/number}","events_url":"https://api.github.com/repos/sinhrks/squarify/events","assignees_url":"https://api.github.com/repos/sinhrks/squarify/assignees{/user}","branches_url":"https://api.github.com/repos/sinhrks/squarify/branches{/branch}","tags_url":"https://api.github.com/repos/sinhrks/squarify/tags","blobs_url":"https://api.github.com/repos/sinhrks/squarify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sinhrks/squarify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sinhrks/squarify/git/refs{/sha}","trees_url":"https://api.github.com/repos/sinhrks/squarify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sinhrks/squarify/statuses/{sha}","languages_url":"https://api.github.com/repos/sinhrks/squarify/languages","stargazers_url":"https://api.github.com/repos/sinhrks/squarify/stargazers","contributors_url":"https://api.github.com/repos/sinhrks/squarify/contributors","subscribers_url":"https://api.github.com/repos/sinhrks/squarify/subscribers","subscription_url":"https://api.github.com/repos/sinhrks/squarify/subscription","commits_url":"https://api.github.com/repos/sinhrks/squarify/commits{/sha}","git_commits_url":"https://api.github.com/repos/sinhrks/squarify/git/commits{/sha}","comments_url":"https://api.github.com/repos/sinhrks/squarify/comments{/number}","issue_comment_url":"https://api.github.com/repos/sinhrks/squarify/issues/comments/{number}","contents_url":"https://api.github.com/repos/sinhrks/squarify/contents/{+path}","compare_url":"https://api.github.com/repos/sinhrks/squarify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sinhrks/squarify/merges","archive_url":"https://api.github.com/repos/sinhrks/squarify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sinhrks/squarify/downloads","issues_url":"https://api.github.com/repos/sinhrks/squarify/issues{/number}","pulls_url":"https://api.github.com/repos/sinhrks/squarify/pulls{/number}","milestones_url":"https://api.github.com/repos/sinhrks/squarify/milestones{/number}","notifications_url":"https://api.github.com/repos/sinhrks/squarify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sinhrks/squarify/labels{/name}","releases_url":"https://api.github.com/repos/sinhrks/squarify/releases{/id}","created_at":"2014-03-16T03:33:36Z","updated_at":"2014-03-16T06:25:58Z","pushed_at":"2014-03-16T06:16:43Z","git_url":"git://github.com/sinhrks/squarify.git","ssh_url":"git@github.com:sinhrks/squarify.git","clone_url":"https://github.com/sinhrks/squarify.git","svn_url":"https://github.com/sinhrks/squarify","homepage":"","size":139,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","master_branch":"master"}},"base":{"label":"laserson:master","ref":"master","sha":"fb8a54a9d1f248570c8be2de1361aa390b2f667d","user":{"login":"laserson","id":118141,"avatar_url":"https://gravatar.com/avatar/5e7d07a5c973dc73e801bf2c3e3db34f?d=https%3A%2F%2Fidenticons.github.com%2Fb7fa576daa40f49d0ae499710bfd5c8a.png&r=x","gravatar_id":"5e7d07a5c973dc73e801bf2c3e3db34f","url":"https://api.github.com/users/laserson","html_url":"https://github.com/laserson","followers_url":"https://api.github.com/users/laserson/followers","following_url":"https://api.github.com/users/laserson/following{/other_user}","gists_url":"https://api.github.com/users/laserson/gists{/gist_id}","starred_url":"https://api.github.com/users/laserson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laserson/subscriptions","organizations_url":"https://api.github.com/users/laserson/orgs","repos_url":"https://api.github.com/users/laserson/repos","events_url":"https://api.github.com/users/laserson/events{/privacy}","received_events_url":"https://api.github.com/users/laserson/received_events","type":"User","site_admin":false},"repo":{"id":8740350,"name":"squarify","full_name":"laserson/squarify","owner":{"login":"laserson","id":118141,"avatar_url":"https://gravatar.com/avatar/5e7d07a5c973dc73e801bf2c3e3db34f?d=https%3A%2F%2Fidenticons.github.com%2Fb7fa576daa40f49d0ae499710bfd5c8a.png&r=x","gravatar_id":"5e7d07a5c973dc73e801bf2c3e3db34f","url":"https://api.github.com/users/laserson","html_url":"https://github.com/laserson","followers_url":"https://api.github.com/users/laserson/followers","following_url":"https://api.github.com/users/laserson/following{/other_user}","gists_url":"https://api.github.com/users/laserson/gists{/gist_id}","starred_url":"https://api.github.com/users/laserson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laserson/subscriptions","organizations_url":"https://api.github.com/users/laserson/orgs","repos_url":"https://api.github.com/users/laserson/repos","events_url":"https://api.github.com/users/laserson/events{/privacy}","received_events_url":"https://api.github.com/users/laserson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/laserson/squarify","description":"Pure Python implementation of the squarify treemap layout algorithm","fork":false,"url":"https://api.github.com/repos/laserson/squarify","forks_url":"https://api.github.com/repos/laserson/squarify/forks","keys_url":"https://api.github.com/repos/laserson/squarify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laserson/squarify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laserson/squarify/teams","hooks_url":"https://api.github.com/repos/laserson/squarify/hooks","issue_events_url":"https://api.github.com/repos/laserson/squarify/issues/events{/number}","events_url":"https://api.github.com/repos/laserson/squarify/events","assignees_url":"https://api.github.com/repos/laserson/squarify/assignees{/user}","branches_url":"https://api.github.com/repos/laserson/squarify/branches{/branch}","tags_url":"https://api.github.com/repos/laserson/squarify/tags","blobs_url":"https://api.github.com/repos/laserson/squarify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laserson/squarify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laserson/squarify/git/refs{/sha}","trees_url":"https://api.github.com/repos/laserson/squarify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laserson/squarify/statuses/{sha}","languages_url":"https://api.github.com/repos/laserson/squarify/languages","stargazers_url":"https://api.github.com/repos/laserson/squarify/stargazers","contributors_url":"https://api.github.com/repos/laserson/squarify/contributors","subscribers_url":"https://api.github.com/repos/laserson/squarify/subscribers","subscription_url":"https://api.github.com/repos/laserson/squarify/subscription","commits_url":"https://api.github.com/repos/laserson/squarify/commits{/sha}","git_commits_url":"https://api.github.com/repos/laserson/squarify/git/commits{/sha}","comments_url":"https://api.github.com/repos/laserson/squarify/comments{/number}","issue_comment_url":"https://api.github.com/repos/laserson/squarify/issues/comments/{number}","contents_url":"https://api.github.com/repos/laserson/squarify/contents/{+path}","compare_url":"https://api.github.com/repos/laserson/squarify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laserson/squarify/merges","archive_url":"https://api.github.com/repos/laserson/squarify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laserson/squarify/downloads","issues_url":"https://api.github.com/repos/laserson/squarify/issues{/number}","pulls_url":"https://api.github.com/repos/laserson/squarify/pulls{/number}","milestones_url":"https://api.github.com/repos/laserson/squarify/milestones{/number}","notifications_url":"https://api.github.com/repos/laserson/squarify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laserson/squarify/labels{/name}","releases_url":"https://api.github.com/repos/laserson/squarify/releases{/id}","created_at":"2013-03-12T23:02:47Z","updated_at":"2013-12-06T21:10:42Z","pushed_at":"2013-04-16T07:38:57Z","git_url":"git://github.com/laserson/squarify.git","ssh_url":"git@github.com:laserson/squarify.git","clone_url":"https://github.com/laserson/squarify.git","svn_url":"https://github.com/laserson/squarify","homepage":"","size":160,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master","master_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/laserson/squarify/pulls/1"},"html":{"href":"https://github.com/laserson/squarify/pull/1"},"issue":{"href":"https://api.github.com/repos/laserson/squarify/issues/1"},"comments":{"href":"https://api.github.com/repos/laserson/squarify/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/laserson/squarify/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/laserson/squarify/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/laserson/squarify/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/laserson/squarify/statuses/df041b8143558c0bf122239fca4d4251cbfed298"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":61,"deletions":1,"changed_files":1}}