{"action":"created","issue":{"url":"https://api.github.com/repos/vispy/vispy/issues/749","labels_url":"https://api.github.com/repos/vispy/vispy/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/749/comments","events_url":"https://api.github.com/repos/vispy/vispy/issues/749/events","html_url":"https://github.com/vispy/vispy/issues/749","id":62101993,"number":749,"title":"Improve vispy.plot interface and implementation","user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vispy/vispy/labels/component:%20plot","name":"component: plot","color":"c7def8"},{"url":"https://api.github.com/repos/vispy/vispy/labels/for-new-contributors","name":"for-new-contributors","color":"d4c5f9"},{"url":"https://api.github.com/repos/vispy/vispy/labels/sprint-2015","name":"sprint-2015","color":"e11d21"},{"url":"https://api.github.com/repos/vispy/vispy/labels/type:%20enhancement","name":"type: enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-16T14:44:55Z","updated_at":"2015-03-16T17:51:51Z","closed_at":null,"body":"This issue regroups a few thoughs and suggestions about the plot interface.\r\n\r\n* Allow marker_size argument in LinePlot\r\n* All public functions should have a full docstring\r\n* The plot interface should be as close as possible as the scene interface. A user who wants to go from the plot interface to the scene interface for more customization and interactivity options should not need to learn yet another way of doing the same thing.\r\n* We keep a stack of all opened figures (=canvases). When issuing a new plot command, the last opened canvas is used, or a new one is created.\r\n* `vp.figures()` returns the list of opened figures.\r\n* `vp.figure()` creates a new figure and returns it.\r\n* `vp.figure(index=2)` returns the 3 opened figure, or raises an error if it doesn't exist.\r\n* `vp.figure(index='last')` or `index=-1` returns the last opened figure.\r\n* Plot functions return a list of visuals that have been added to the current figure.\r\n* All plot functions will share some set of keyword arguments, and the implementation should factor out that reusable set of functionality among the functions. Example:\r\n  * background color\r\n  * camera\r\n* Subplot API\r\n* Grid, axes, legend, labels..."},"comment":{"url":"https://api.github.com/repos/vispy/vispy/issues/comments/81840583","html_url":"https://github.com/vispy/vispy/issues/749#issuecomment-81840583","issue_url":"https://api.github.com/repos/vispy/vispy/issues/749","id":81840583,"user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T17:51:50Z","updated_at":"2015-03-16T17:51:50Z","body":"> Yeah, this looks good.\r\n\r\n+1\r\n\r\n> It also lends itself nicely to expansion to multiple subplots, etc.:\r\n> \r\n> import vispy.plot as vp\r\n> fig, axes = vp.subplots(2, 2)\r\n> axes[0, 0].plot(...)\r\n> axes[1, 0].plot(...)\r\n\r\nWhat is the advantage of returning two objects `fig, axes` (I think that's a matplotlib thing)? Would it be possible to return a single object that would combine both? For example:\r\n\r\n```python\r\nfig = vp.subplots(2, 2)\r\nfig[0, 0].plot(...)\r\nax = fig[1, 0]\r\nax.plot(...)\r\nfig.show()\r\n```"}}