How to increase plotting speed?