I have a situation which is puzzling.
I have a web page that, when generated embeds links that look like:
</div><img src="/analysis/design/chart?field=A></div>
</div><img src="/analysis/design/chart?field=B></div>
</div><img src="/analysis/design/chart?field=C></div>
Each of these links points to a view that, when activated, creates a small PNG image (matplotlib is used for this) which is returned via an InMemoryUploadedFile object.
The basic logic and image construction works - if each of these links is called directly from the browser, then each is created perfectly.
However, when embedded in a single page (as above) then only one single image is returned and the rest generate a similar error:
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1401, in xlabel
l = gca().set_xlabel(s, *args, **kwargs)
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 803, in gca
ax = gcf().gca(**kwargs)
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1221, in gca
return self.add_subplot(1, 1, 1, **kwargs)
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py", line 916, in add_subplot
self._axstack.add(key, a)
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py", line 120, in add
Stack.remove(self, (key, a_existing))
File "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/cbook.py", line 1343, in remove
raise ValueError('Unknown element o')
ValueError: Unknown element o
I have googled for this error, but it seems fairly obscure and I am not sure how it relates to my situation.
Any insights welcome!
Thanks
Derek