CUDA accelerate Matplotlib

Viewed 564

I am trying to visualize the evolution of my data by looping through it, plotting it, saving it as an image, then reconstructing the sequence of images into a video via FFmpeg.

df = pd.DataFrame()
df['seconds'] = seconds
df['data'] = data

for x in range(2000, len(data)):
    start = x-2000
    end = x-1
    plt.figure(figsize=[15,20])
    
    plt.subplot(211)
    plt.plot(df['data'].iloc[:end])
    plt.title(f"Observation: {end}  Time: {df['seconds'].iloc[end]} seconds", fontsize=30, ha='center')
    plt.xlim(right=len(data))
    plt.xlabel('Observation',fontsize = 20)
    plt.ylabel('Data', fontsize = 20)
    plt.ticklabel_format(useOffset=False)
    plt.grid()

    plt.subplot(212)
    plt.plot(df['data'].iloc[start:end])
    plt.xlabel('Observation',fontsize = 20)
    plt.ylabel('Data', fontsize = 20)
    plt.ticklabel_format(useOffset=False)
    plt.grid()

    plt.savefig(f"dataset/{end}.jpg")
    plt.close()

First subplot is an expanding window while the second subplot is a rolling window.

len(data) comes out to around half a million elements and I project this will take FOREVER for one render, and I have several of these I need to do.

I have a Nvidia GPU and was wondering if this can be CUDA accelerated. It seems Nvidia has something called 'Anaconda Accelerate' but their site has dead links: https://developer.nvidia.com/anaconda-accelerate So I don't suppose this is offerred anymore.

Is there a way to accelerate the plotting and saving of MPL plots? This would help immensely!

Thank you

0 Answers
Related