{"action":"created","issue":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/632","repository_url":"https://api.github.com/repos/Qiskit/qiskit-terra","labels_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/632/labels{/name}","comments_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/632/comments","events_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/632/events","html_url":"https://github.com/Qiskit/qiskit-terra/pull/632","id":339712332,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMjk2ODAz","number":632,"title":"Matplotlib circuit drawer margin adjust","user":{"login":"nkanazawa1989","id":39517270,"node_id":"MDQ6VXNlcjM5NTE3Mjcw","avatar_url":"https://avatars2.githubusercontent.com/u/39517270?v=4","gravatar_id":"","url":"https://api.github.com/users/nkanazawa1989","html_url":"https://github.com/nkanazawa1989","followers_url":"https://api.github.com/users/nkanazawa1989/followers","following_url":"https://api.github.com/users/nkanazawa1989/following{/other_user}","gists_url":"https://api.github.com/users/nkanazawa1989/gists{/gist_id}","starred_url":"https://api.github.com/users/nkanazawa1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkanazawa1989/subscriptions","organizations_url":"https://api.github.com/users/nkanazawa1989/orgs","repos_url":"https://api.github.com/users/nkanazawa1989/repos","events_url":"https://api.github.com/users/nkanazawa1989/events{/privacy}","received_events_url":"https://api.github.com/users/nkanazawa1989/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-10T06:41:20Z","updated_at":"2018-07-10T07:32:44Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/pulls/632","html_url":"https://github.com/Qiskit/qiskit-terra/pull/632","diff_url":"https://github.com/Qiskit/qiskit-terra/pull/632.diff","patch_url":"https://github.com/Qiskit/qiskit-terra/pull/632.patch"},"body":"<!--\r\n⚠️ If you do not respect this template, your pull request will be closed.\r\n⚠️ Your pull request title should be short detailed and understandable for all.\r\n⚠️ Also, please add it in the CHANGELOG file under Unreleased section.\r\n⚠️ If your pull request fixes an open issue, please link to the issue.\r\n\r\n✅ I have added the tests to cover my changes.\r\n✅ I have updated the documentation accordingly.\r\n✅ I have read the CONTRIBUTING document.\r\n-->\r\n\r\n### Summary\r\n- Remove redundant margin of figures generated by `matplotlib_circuit_drawer()` \r\n- Add `margin` key in style sheet for user-oriented configuration.\r\n\r\n### Details and comments\r\nImplemented key `style = {'margin': [l, r, b, t]}` can specify (l) left, (r) right, (b) bottom and (t) top margins surrounding a circuit diagram. Default value is `'margin': [2.0, 0.0, 0.0, 0.3]`.\r\n\r\n![image](https://user-images.githubusercontent.com/39517270/42492727-27e8b53a-8455-11e8-84a2-5afceee5ffe7.png)\r\n\r\nExample: increase margins (+0.5)\r\n```\r\nfrom qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister\r\nfrom qiskit.tools.visualization import matplotlib_circuit_drawer as drawer\r\nqr = QuantumRegister(1, 'q')\r\ncircuit = QuantumCircuit(qr)\r\ncircuit.x(qr[0])\r\nmy_style = {'margin': [2.5, 0.5, 0.5, 0.8]}\r\ndrawer(circuit, style=my_style)\r\n```\r\n![image](https://user-images.githubusercontent.com/39517270/42492691-0a7ad1f4-8455-11e8-8016-2ec2fb05e6b1.png)"},"comment":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/comments/403728827","html_url":"https://github.com/Qiskit/qiskit-terra/pull/632#issuecomment-403728827","issue_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/632","id":403728827,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzcyODgyNw==","user":{"login":"nkanazawa1989","id":39517270,"node_id":"MDQ6VXNlcjM5NTE3Mjcw","avatar_url":"https://avatars2.githubusercontent.com/u/39517270?v=4","gravatar_id":"","url":"https://api.github.com/users/nkanazawa1989","html_url":"https://github.com/nkanazawa1989","followers_url":"https://api.github.com/users/nkanazawa1989/followers","following_url":"https://api.github.com/users/nkanazawa1989/following{/other_user}","gists_url":"https://api.github.com/users/nkanazawa1989/gists{/gist_id}","starred_url":"https://api.github.com/users/nkanazawa1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkanazawa1989/subscriptions","organizations_url":"https://api.github.com/users/nkanazawa1989/orgs","repos_url":"https://api.github.com/users/nkanazawa1989/repos","events_url":"https://api.github.com/users/nkanazawa1989/events{/privacy}","received_events_url":"https://api.github.com/users/nkanazawa1989/received_events","type":"User","site_admin":false},"created_at":"2018-07-10T07:32:44Z","updated_at":"2018-07-10T07:32:44Z","author_association":"NONE","body":"I linked my accounts to process CLA and reopen this PR. The code is not changed."}}
{"actor":{"display_login":"nkanazawa1989"}}