Relative Content

Tag Archive for pythonperformancematplotlibmemorymemory-management

When using `matplotlib.animation` and ‘LineCollection`, how to reduce the size of the colors list

I am continuously plotting data using matplotlib.animation with multiple subplots that use a lot of segments. The issue I am running into is that size of the colors list is quite large ['Blue','Blue',... 'green','green','red',..] so the ram being used it quite large. I was thinking of compressing the data, but the issue is that every half second or so, a new data point and segment is added to the plot, therefore I will decompressing the list anyway.