{"action":"closed","issue":{"url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/124","repository_url":"https://api.github.com/repos/nschloe/matplotlib2tikz","labels_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/124/comments","events_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/124/events","html_url":"https://github.com/nschloe/matplotlib2tikz/issues/124","id":193614537,"number":124,"title":"Missing \\end{groupplot} for subplot","user":{"login":"noirchen","id":5509175,"avatar_url":"https://avatars.githubusercontent.com/u/5509175?v=3","gravatar_id":"","url":"https://api.github.com/users/noirchen","html_url":"https://github.com/noirchen","followers_url":"https://api.github.com/users/noirchen/followers","following_url":"https://api.github.com/users/noirchen/following{/other_user}","gists_url":"https://api.github.com/users/noirchen/gists{/gist_id}","starred_url":"https://api.github.com/users/noirchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noirchen/subscriptions","organizations_url":"https://api.github.com/users/noirchen/orgs","repos_url":"https://api.github.com/users/noirchen/repos","events_url":"https://api.github.com/users/noirchen/events{/privacy}","received_events_url":"https://api.github.com/users/noirchen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-05T21:26:31Z","updated_at":"2016-12-08T19:15:27Z","closed_at":"2016-12-08T19:15:27Z","body":"I use matplotlib2tikz to generate a tikz file for a figure with several subplots, and I notice that when the number of subplots is smaller than row*col, the final tikz file won't compile because of missing `\\end{groupplot}`. A minimal working python template looks like this.\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nx = np.linspace(0, np.pi)\r\n\r\nfig = plt.figure()\r\nfignum = 8  # the problem goes away if fignum is 9\r\nfor subid in range(fignum):\r\n    sub = fig.add_subplot(3, 3, subid + 1)\r\n    y = np.sin(x)\r\n    sub.plot(x, y)\r\n\r\nfrom matplotlib2tikz import save as tikz_save\r\ntikz_save('test.tikz')\r\n```\r\nBut if `fignum` is 9 in the code above, the resulting tikz is compilable. I can work around this by either manually adding `\\end{groupplot}` to the tikz file, or changing the row and column number. I think a quick patch will work.\r\n"}}
{"actor":{"display_login":"nschloe"}}