{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5795","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5795/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5795/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5795/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5795","id":124929365,"number":5795,"title":"segmentation fault when plotting large number of images","user":{"login":"ProkopHapala","id":3408568,"avatar_url":"https://avatars.githubusercontent.com/u/3408568?v=3","gravatar_id":"","url":"https://api.github.com/users/ProkopHapala","html_url":"https://github.com/ProkopHapala","followers_url":"https://api.github.com/users/ProkopHapala/followers","following_url":"https://api.github.com/users/ProkopHapala/following{/other_user}","gists_url":"https://api.github.com/users/ProkopHapala/gists{/gist_id}","starred_url":"https://api.github.com/users/ProkopHapala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProkopHapala/subscriptions","organizations_url":"https://api.github.com/users/ProkopHapala/orgs","repos_url":"https://api.github.com/users/ProkopHapala/repos","events_url":"https://api.github.com/users/ProkopHapala/events{/privacy}","received_events_url":"https://api.github.com/users/ProkopHapala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-05T09:42:35Z","updated_at":"2016-01-06T18:07:53Z","closed_at":null,"body":"Hello, when I plot few hundred of images the matplotlib crash with segmentation fault. This is the minimal code which reproduce the error ( I generate random 3D datagrids and then plot each slice and store figure to file ):\r\n\r\n\timport numpy as np\r\n\timport matplotlib.pyplot as plt\r\n\r\n\tdefault_figsize = (3,3)\r\n\r\n\tdef plotImages( prefix, F, figsize=default_figsize ):\r\n\t\tslices = range( len( F ) )\r\n\t\tfor ii,i in enumerate(slices):\r\n\t\t\tprint \" plotting \", i\r\n\t\t\tplt.figure( figsize=figsize )\r\n\t\t\tplt.imshow( F[i], origin='image' )\r\n\t\t\tplt.title( r\"iz = %i\" %i  )\r\n\t\t\tplt.savefig( prefix+'_%3.3i.png' %i, bbox_inches='tight' )\r\n\t\t\tplt.close()\r\n\r\n\r\n\tnx = 500\r\n\tny = 500\r\n\tnz = 100\r\n\tng = 100\r\n\r\n\tfor i in range( ng ):\r\n\t\tF = np.random.randn( nz,ny,nx )\r\n\t\tprint \"NEW GRID \", i , \" : \", np.shape(F)\r\n\t\tplotImages( \"\", F )\r\n\t\tdel F\r\n\r\nin this case the error happened after at grid 12 image 54 ( i.e. 11*100 + 54 = 1154 images ). But the exact point of crash depends on many parameters (size of grids, size of images, and probably also memory usage on my machine ). I do not know how to trace it. \r\n\r\nI originaly asked this as github question:\r\nhttp://stackoverflow.com/questions/34592311/matplotlib-segmentation-fault-when-plotting-large-number-of-images"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/169406744","html_url":"https://github.com/matplotlib/matplotlib/issues/5795#issuecomment-169406744","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5795","id":169406744,"user":{"login":"ProkopHapala","id":3408568,"avatar_url":"https://avatars.githubusercontent.com/u/3408568?v=3","gravatar_id":"","url":"https://api.github.com/users/ProkopHapala","html_url":"https://github.com/ProkopHapala","followers_url":"https://api.github.com/users/ProkopHapala/followers","following_url":"https://api.github.com/users/ProkopHapala/following{/other_user}","gists_url":"https://api.github.com/users/ProkopHapala/gists{/gist_id}","starred_url":"https://api.github.com/users/ProkopHapala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProkopHapala/subscriptions","organizations_url":"https://api.github.com/users/ProkopHapala/orgs","repos_url":"https://api.github.com/users/ProkopHapala/repos","events_url":"https://api.github.com/users/ProkopHapala/events{/privacy}","received_events_url":"https://api.github.com/users/ProkopHapala/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T18:07:53Z","updated_at":"2016-01-06T18:07:53Z","body":"hi ... I did not rebult it, I istalled it somehow (don't remeber how) ...\r\n\r\nok ... I will try to reinstall it, or try it on other computer "}}