Question: I build some SQL query strings in VBA in an MS Access Database (current Office 365 Access Version) and I ran into a weird **localization problem with boolean values read from form controls**: `Me.MyBooleanControl` returns "Wahr" (german "True") => the generated SQL fails.

I'm using a workaround now, wrapping each value request by a function to translate the values to `-1`/ `0` like suggested [here](https://stackoverflow.com/a/1529288/1349511), but I really like to know if there's a straight way to avoid this. I used the same code structure last year in another Access Database not running into the same problem - and I've absolutely no idea what's different (besides MS Office my have been updated).

**Edit**: I found the solution, see answer below.

Answer: 
Here is an adaption of [this example](https://matplotlib.org/2.0.2/examples/animation/dynamic_image.html) to work with two lists of data.
Note that when the images don't all have the same range of data, the range will be taken from the first element drawn. A workaround is to explicitly set vmin and vmax to the global minimum and maximum.

```py
from matplotlib import pyplot as plt
from matplotlib import animation
import numpy as np

x, y = np.meshgrid(np.linspace(0, 5, 30), np.linspace(0, 5, 10))
list1 = [np.sin(x + i * 0.10) * np.cos(y + i * 0.01) for i in range(50)]
list2 = [np.cos(x + i * 0.01) * np.sin(y + i * 0.10) for i in range(50)]
list1[0] = np.zeros_like(list1[0])  # test what happens when the first element has only one color

fig = plt.figure()

ax1 = fig.add_subplot(2, 1, 1)

vmin1 = min([l.min() for l in list1 ])
vmin2 = min([l.min() for l in list2 ])
vmax1 = max([l.max() for l in list1 ])
vmax2 = max([l.max() for l in list2 ])
ax2 = fig.add_subplot(2, 1, 2)
im1 = ax1.imshow(list1[0], interpolation=None, animated=True, vmin=vmin1, vmax=vmax1)
im2 = ax2.imshow(list2[0], interpolation=None, animated=True, cmap='inferno', vmin=vmin2, vmax=vmax2)

def updatefig(i):
    im1.set_array(list1[i])
    im2.set_array(list2[i])
    return im1, im2,

ani = animation.FuncAnimation(fig, updatefig, frames=len(list1), interval=20, blit=True)
plt.show()

```
You can save it to an *"in-memory"* buffer like this:

```
# Save PNG to memory buffer as BytesIO
from io import BytesIO
buffer = BytesIO()

plt.savefig(buffer,format='png')
PNG = buffer.getvalue()

```

If you mean you want a PIL/Pillow Image from that:

```
reloadedPILImage = Image.open(buffer)

```