This is a weird smearing effect I've never seen before in rendered matplotlib figures that looks like a printer error. I'm not clear on what might be causing it. I'm processing a sizeable dataframe (4.5gb) to render two copies of the same figure generated from each row, filenames are derived from the data which is why they're not simply copied and renamed after the process.
Here's a simpler version with np.random
instead of the dataframe:
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import time as time
data = np.random.random((20,6))
labels = ['a','b','c','d','e','f']
plt.figure(figsize=(25,15))
plt.rcParams.update({"font.size": "15"})
plt.matshow(data.T, fignum=1, aspect='auto')
plt.title('title', pad=15, wrap=True)
plt.yticks(np.arange(len(labels)), labels)
ax = plt.gca()
# Set the X locator to index every 10 points (30 seconds) with no offset
ax.xaxis.set_major_locator(plt.IndexLocator(base=10, offset=0.))
# Multiply each tick by 3 and add 2 to get correct labels
ax.set_xticklabels([time.strftime('%M:%S', time.gmtime(item * 3 + 2)) for item in ax.get_xticks()])
ax.xaxis.set_ticks_position('bottom')
plt.xlabel('Time', labelpad=15)
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="3%", pad=0.15)
plt.colorbar(cax=cax)
render = './path1/filename1.jpg'
plt.savefig(render)
track = './path2/filename2.jpg'
plt.savefig(render)
However I can't seem to reproduce the effect using the simplified version here. The script is actually running on a VM and using dask
over an apply
loop, but I don’t think that’s a factor