Closed
Description
I already posted this as a question on Stack Overflow.
Minimal example:
import numpy as np
import matplotlib.pyplot as plt
img = np.arange(100).reshape((10,10))
plt.imshow(img, extent = [0.25, 0.75, 0.25, 0.75], zorder = 10)
plt.imshow(img, extent = [0.1, 0.9, 0.1, 0.9], zorder = 1)
plt.plot([0, 1], [0, 1], color = 'black', zorder = 5)
plt.axis([0, 1, 0, 1])
plt.savefig('img.png')
When exporting to PNG, the output is as expected:
However, when saving to PDF, the zorder is not respected (the line is plotted over both images):
Is this a bug?