Hi, I've been plotting data with millions of datapoints, and it takes a long time for the plot to draw and to rescale with the mouse. I was playing around with the draw_lines function in the agg backend and sped it up a bit, maybe others will find it useful. I've attached my optimized version of _backend_agg.cpp. (just replace the old src/_backend_agg.cpp and recompile). The main optimization is to combine sequential lines that are parallel into a single line to be drawn once. Try "plot(rand(100000),'-')" to see the change. Resizing and zooming should be faster than before. This comes at the expense of accuracy since many lines are not drawn. I've tried to balance out accuracy vs speed to my liking. The main thing to tweak is a length threshold which I have hardcoded to 0.25. This is the squared length in pixels that we can move in the direction perpendicular to the set of parallel lines we are combining and still combine the lines. (so it can move 0.5 pixels to the side before a new line will be started). If you set it to 0, you should get the same plots as without my changes. I also made it skip any lines that are outside of the drawing area. Hopefully it's not buggy! Allan