Javascript Limit Array Size Python Compiler With Matplotlib