{"action":"created","issue":{"url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/18","labels_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/18/comments","events_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/18/events","html_url":"https://github.com/arokem/python-matlab-bridge/issues/18","id":11771558,"number":18,"title":"control size of figure output a la rmagic","user":{"login":"shabbychef","id":1456159,"avatar_url":"https://avatars.githubusercontent.com/u/1456159?v=3","gravatar_id":"","url":"https://api.github.com/users/shabbychef","html_url":"https://github.com/shabbychef","followers_url":"https://api.github.com/users/shabbychef/followers","following_url":"https://api.github.com/users/shabbychef/following{/other_user}","gists_url":"https://api.github.com/users/shabbychef/gists{/gist_id}","starred_url":"https://api.github.com/users/shabbychef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shabbychef/subscriptions","organizations_url":"https://api.github.com/users/shabbychef/orgs","repos_url":"https://api.github.com/users/shabbychef/repos","events_url":"https://api.github.com/users/shabbychef/events{/privacy}","received_events_url":"https://api.github.com/users/shabbychef/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-03-07T18:03:06Z","updated_at":"2015-02-04T22:53:39Z","closed_at":null,"body":"The ```%R``` magic extension allows control of displayed figures in the iPython notebook, like so:\r\n```\r\n%R -w 700 -h 500\r\nhist(rnorm(1000))\r\n# etc\r\n```\r\nIt should be easy to nick this code from the rmagic extension."},"comment":{"url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/comments/72958014","html_url":"https://github.com/arokem/python-matlab-bridge/issues/18#issuecomment-72958014","issue_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/18","id":72958014,"user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T22:53:38Z","updated_at":"2015-02-04T22:53:38Z","body":"@arokem, I can take this one.  Here's what I suggest:  add format and size to `make_figs` to make it look like this:\r\n\r\n```matlab\r\nfunction make_figs(figdir, fmt, width, height)\r\n    figHandles = get(0, 'children');\r\n    for fig=1:length(figHandles)\r\n        f = figHandles(fig);\r\n        p = get(f, 'position');\r\n          if p(3) > width\r\n                height = p(4) * width / p(3);\r\n          end\r\n          if p(4) > height\r\n                width = p(3) * height / p(4);\r\n          end\r\n          size_fmt = sprintf('-S%d,%d', width, height);\r\n          outfile = fullfile(figdir, ['MatlabFig', sprintf('%03d', fig)]);\r\n          print_fmt = sprintf('-d%s', fmt)\r\n          print(f, outfile, print_fmt, '-tight', size_fmt);\r\n        close(fig);\r\n    end;\r\nendfunction;\r\n```\r\n\r\nAnd then mimic what [octave_magic](https://github.com/blink1073/oct2py/blob/master/oct2py/ipython/octavemagic.py#L189) uses for plot formatting.  This would allow us to provide this feature in the `matlab_kernel` (already provided in the `octave_kernel`)."}}