Monday, 7 December 2020

Matplotlib savefig() OSError: [Errno 30] Read-only file system: 'image.png'

I'm trying to write a program that will create a matplotlib chart and save the png file. I've tried using the savefig() method (more info here), but it gives me the following error:

OSError: [Errno 30] Read-only file system: 'image.png'

Here is my code:

fig = plt.figure()
    plt.title("Bar (Spreading of transactions)")
    plt.plot(bar_x, bar_y)
    plt.savefig("image.png")

I will later need to save this file in a temporary file and access it using Flask.



from Matplotlib savefig() OSError: [Errno 30] Read-only file system: 'image.png'

No comments:

Post a Comment