{"action":"opened","issue":{"url":"https://api.github.com/repos/dilcom/gnuplotrb/issues/32","labels_url":"https://api.github.com/repos/dilcom/gnuplotrb/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/dilcom/gnuplotrb/issues/32/comments","events_url":"https://api.github.com/repos/dilcom/gnuplotrb/issues/32/events","html_url":"https://github.com/dilcom/gnuplotrb/issues/32","id":98446844,"number":32,"title":"Better configuration for multiplot","user":{"login":"v0dro","id":2629909,"avatar_url":"https://avatars.githubusercontent.com/u/2629909?v=3","gravatar_id":"","url":"https://api.github.com/users/v0dro","html_url":"https://github.com/v0dro","followers_url":"https://api.github.com/users/v0dro/followers","following_url":"https://api.github.com/users/v0dro/following{/other_user}","gists_url":"https://api.github.com/users/v0dro/gists{/gist_id}","starred_url":"https://api.github.com/users/v0dro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v0dro/subscriptions","organizations_url":"https://api.github.com/users/v0dro/orgs","repos_url":"https://api.github.com/users/v0dro/repos","events_url":"https://api.github.com/users/v0dro/events{/privacy}","received_events_url":"https://api.github.com/users/v0dro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-31T18:34:04Z","updated_at":"2015-07-31T18:34:04Z","closed_at":null,"body":"Currently I'm using the following code with a daru dataframe to plot each Vector on a different sub-plot in a Multiplot:\r\n``` ruby\r\n\r\nplots = []\r\ndata_frame.each_vector_with_index do |vec,n|\r\n  plots << Plot.new([vec, with: 'lines', title: n])\r\nend\r\n\r\nMultiplot.new(*plots, layout: [3,1], title: 'Rolling sums')\r\n```\r\nThis produces a plot that looks like this:\r\n![plot](https://cloud.githubusercontent.com/assets/2629909/9014360/8c6ce302-37df-11e5-9402-9bc823695912.jpg)\r\n\r\nI found it pretty hard to configure multiplot to create a series 3 plots stacked on top of each other that share a common X axis at the bottom.\r\n\r\nSomething like this:\r\n![](http://i.stack.imgur.com/FHDS2.png)\r\n\r\nTo do this how about having a DSL that would go something like:\r\n``` ruby\r\n\r\nMultiplot.new(many, plots, and, options) do |mp|\r\n  mp.title = \"Some title\"\r\n  mp.layout = [2,3]\r\n  plots = mp.yield_plots\r\n  plots[0].upper_margin = 0\r\n  # etc.\r\nend\r\n\r\n# Please dont let my ignorance of the GNU Plot API get in the way here.\r\n```\r\n\r\n[Here](http://stackoverflow.com/questions/19131509/multiplot-stacking-3-graphs-on-a-larger-canvas) is an SO answer relating to stacking graphs.\r\n\r\nThis might be related to #29 "}}