1

Ho, I want to plot 24 images in 1 plot using subplot.

I've already made the empty plots using this method:

# Import everything from matplotlib (numpy is accessible via 'np' alias)
from pylab import *

# create new figure of a3 size.
figure(figsize=(16.5, 11.7), dpi=300)

# do plotting for 24 figs in 1 plot
for i in range(1, 25):
    #print i
    subplot(4, 6, i)

Now i want to fill my subplots with the same data in everyplot (a background to plot against) in a line plot. I do this using the following line:

    plot(myData)

Once i run the program, it crashes telling me:

"_tkinter.TclError: not enough free memory for image buffer"

So after searching the web I read that i need to close the plots after i make them so that the memory can be reused. However, how do i do this when using subplots ?

  • Frank

Edit: I think it would get easily solved if i could 2 lists, 1 with each uniq item in myData, and the second list with the number of occurences of that uniq item. any1 got tips on that ?

MrFronk
  • 382
  • 5
  • 23
  • well, after searching i found this post:http://stackoverflow.com/questions/2600191/how-can-i-count-the-occurrences-of-a-list-item-in-python which i implemented. I managed to use this code "plotDict = Counter(myData)" and then plot it using "plot(plotDict.keys(), plotDict.values())" and now it works :D – MrFronk Nov 13 '13 at 17:49
  • I dont know how to close this question though :x – MrFronk Nov 13 '13 at 17:53
  • Please write an answer explaining how you solved your problem (and accept it when it will let you). – tacaswell Nov 13 '13 at 18:23

0 Answers0