{"action":"created","issue":{"url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/111","repository_url":"https://api.github.com/repos/nschloe/matplotlib2tikz","labels_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/111/comments","events_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/111/events","html_url":"https://github.com/nschloe/matplotlib2tikz/issues/111","id":178574369,"number":111,"title":"Colorbar breaks tex import","user":{"login":"max3-2","id":10244463,"avatar_url":"https://avatars.githubusercontent.com/u/10244463?v=3","gravatar_id":"","url":"https://api.github.com/users/max3-2","html_url":"https://github.com/max3-2","followers_url":"https://api.github.com/users/max3-2/followers","following_url":"https://api.github.com/users/max3-2/following{/other_user}","gists_url":"https://api.github.com/users/max3-2/gists{/gist_id}","starred_url":"https://api.github.com/users/max3-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3-2/subscriptions","organizations_url":"https://api.github.com/users/max3-2/orgs","repos_url":"https://api.github.com/users/max3-2/repos","events_url":"https://api.github.com/users/max3-2/events{/privacy}","received_events_url":"https://api.github.com/users/max3-2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-22T10:34:32Z","updated_at":"2016-09-25T17:31:40Z","closed_at":null,"body":"Having a weird issue with colorbars usage with pyplot.imshow.\r\nPlottng imshow without colorbar exports perfect.\r\nAdding colorbar leads to break due to \r\n\r\na)! Extra }, or forgotten \\endgroup. \r\n  easily fixed by adding endgroup which seems to miss b4 end of tikzfigure\r\nb) ! Package pgf Error: No shape named group c1r-1 is known. (line 283 m marked below)\r\n\r\nstill looking into it, any ideas yet?\r\n\r\n```\r\n% This file was created by matplotlib2tikz v0.5.11.\r\n\\begin{tikzpicture}\r\n\r\n\\begin{axis}[\r\ntitle={A first view},\r\nxmin=-0.5, xmax=639.5,\r\nymin=-0.5, ymax=511.5,\r\naxis on top,\r\ncolorbar,\r\ncolormap={mymap}{[1pt]\r\n  rgb(0pt)=(0.267004,0.004874,0.329415);\r\n...long color def...\r\n  rgb(255pt)=(0.993248,0.906157,0.143936)\r\n},\r\npoint meta min=0,\r\npoint meta max=5,\r\ncolorbar style={ytick={0,0.625,1.25,1.875,2.5,3.125,3.75,4.375,5},yticklabels={0.0,0.6,1.2,1.9,2.5,3.1,3.8,4.4,5.0}}\r\n]\r\n\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-0.5, xmax=639.5, ymin=-0.5, ymax=511.5] {img1.png};\r\n\\end{axis}\r\n\r\n\\nextgroupplot[\r\nylabel={sc. Ir},\r\nxmin=0, xmax=1,\r\nymin=0, ymax=1,\r\naxis on top,\r\naxis y line=right,\r\nytick={0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1},\r\nyticklabels={0.0,0.6,1.2,1.9,2.5,3.1,3.8,4.4,5.0}\r\n>>>line 283:  ]\r\n\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=0, ymax=1] {imageTest_img001.png};\r\n\\path [draw=black, fill opacity=0] (axis cs:0,0)\r\n--(axis cs:0,0.00390625)\r\n--(axis cs:0,0.99609375)\r\n--(axis cs:0,1)\r\n--(axis cs:1,1)\r\n--(axis cs:1,0.99609375)\r\n--(axis cs:1,0.00390625)\r\n--(axis cs:1,0)\r\n--cycle;\r\n\r\n\\path [draw=white, fill=white] (axis cs:0,0)\r\n--(axis cs:0,0.00390625)\r\n--(axis cs:0,0.99609375)\r\n--(axis cs:0,1)\r\n--(axis cs:1,1)\r\n--(axis cs:1,0.99609375)\r\n--(axis cs:1,0.00390625)\r\n--(axis cs:1,0)\r\n--cycle;\r\n>>>>inserting \\endgroup as a quick fix for error one<<<<<\r\n\\end{tikzpicture}\r\n```"},"comment":{"url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/comments/249434525","html_url":"https://github.com/nschloe/matplotlib2tikz/issues/111#issuecomment-249434525","issue_url":"https://api.github.com/repos/nschloe/matplotlib2tikz/issues/111","id":249434525,"user":{"login":"max3-2","id":10244463,"avatar_url":"https://avatars.githubusercontent.com/u/10244463?v=3","gravatar_id":"","url":"https://api.github.com/users/max3-2","html_url":"https://github.com/max3-2","followers_url":"https://api.github.com/users/max3-2/followers","following_url":"https://api.github.com/users/max3-2/following{/other_user}","gists_url":"https://api.github.com/users/max3-2/gists{/gist_id}","starred_url":"https://api.github.com/users/max3-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3-2/subscriptions","organizations_url":"https://api.github.com/users/max3-2/orgs","repos_url":"https://api.github.com/users/max3-2/repos","events_url":"https://api.github.com/users/max3-2/events{/privacy}","received_events_url":"https://api.github.com/users/max3-2/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T17:31:40Z","updated_at":"2016-09-25T17:31:40Z","body":"Ok here's the detailed follow-up. Code below, errors are as above, with same ideas for fixing...\r\n\r\nPython goes as already explained as simple as possible\r\n\r\n``\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib2tikz\r\n\r\nda = np.random.random((512,640))\r\n\r\nfig = plt.figure()\r\nax = plt.gca()\r\n\r\nim = ax.imshow(da, cmap='viridis')\r\ncax = plt.colorbar(im, aspect=10, shrink=0.8)\r\n\r\nplt.title('A new figure')\r\nmatplotlib2tikz.save('aTest.tex')\r\n``\r\n\r\nproduces following tex\r\n\r\n``\r\n% This file was created by matplotlib2tikz v0.5.11.\r\n\\begin{tikzpicture}\r\n\r\n\\begin{axis}[\r\ntitle={A new figure},\r\nxmin=-0.5, xmax=639.5,\r\nymin=-0.5, ymax=511.5,\r\naxis on top,\r\ncolorbar,\r\ncolormap={mymap}{[1pt]\r\n  rgb(0pt)=(0.267004,0.004874,0.329415);\r\n%%%...a lot of colors...\r\n  rgb(255pt)=(0.993248,0.906157,0.143936)\r\n},\r\npoint meta min=7.83885246313787e-06,\r\npoint meta max=0.999999429985691,\r\ncolorbar style={ytick={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9},yticklabels={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}}\r\n]\r\n\\path [draw=black, fill opacity=0] (axis cs:0,511.5)\r\n--(axis cs:0,-0.5);\r\n\r\n\\path [draw=black, fill opacity=0] (axis cs:1,511.5)\r\n--(axis cs:1,-0.5);\r\n\r\n\\path [draw=black, fill opacity=0] (axis cs:-0.5,1)\r\n--(axis cs:639.5,1);\r\n\r\n\\path [draw=black, fill opacity=0] (axis cs:-0.5,0)\r\n--(axis cs:639.5,0);\r\n\r\n\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-0.5, xmax=639.5, ymin=511.5, ymax=-0.5] {img1.png};\r\n\\end{axis}\r\n\r\n\\nextgroupplot[\r\nxmin=0, xmax=1,\r\nymin=0, ymax=1,\r\naxis on top,\r\naxis y line=right,\r\nytick={0.0999930019753686,0.199993842869117,0.299994683762865,0.399995524656613,0.499996365550361,0.599997206444109,0.699998047337857,0.799998888231605,0.899999729125354},\r\nyticklabels={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}\r\n]\r\n\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=0, ymax=1] {aTest_img001.png};\r\n\\path [draw=black, fill opacity=0] (axis cs:0,0)\r\n--(axis cs:0,0.00390625)\r\n--(axis cs:0,0.99609375)\r\n--(axis cs:0,1)\r\n--(axis cs:1,1)\r\n--(axis cs:1,0.99609375)\r\n--(axis cs:1,0.00390625)\r\n--(axis cs:1,0)\r\n--cycle;\r\n\r\n\\path [draw=white, fill=white] (axis cs:0,0)\r\n--(axis cs:0,0.00390625)\r\n--(axis cs:0,0.99609375)\r\n--(axis cs:0,1)\r\n--(axis cs:1,1)\r\n--(axis cs:1,0.99609375)\r\n--(axis cs:1,0.00390625)\r\n--(axis cs:1,0)\r\n--cycle;\r\n\r\n\\end{tikzpicture}\r\n``\r\n\r\nTex has in the preamble:\r\n\r\n``\r\n\\usepackage{tikz,pgfplots}\r\n\\usetikzlibrary[pgfplots.groupplots]\r\n\\pgfplotsset{compat=1.12}\r\n``\r\n\r\nand the line producing the error\r\n\r\n``\r\n\\include{aTest}\r\n``"}}
{"actor":{"display_login":"max3-2"}}