I have a large (~6GB) text file in a simple format

```
x1 y1 z1
x2 y2 z2
...

```

Since I may load this data more than once, I've created a `np.memmap` file for efficiency reasons: 

```
X,Y,Z = np.memmap(f_np_mmap,dtype='float32',mode='r',shape=shape).T

```

What I'm trying to do is plot:

```
plt.scatter(X, Y, 
           color=custom_colorfunction(Z), 
           alpha=.01, s=.001, marker='s', linewidth=0)

```

This works perfectly for smaller datasets. However, for this larger dataset I run out of memory. I've checked that `plt.scatter` is taking all the memory; I can step through `X,Y,Z` just fine. Is there a way I "rasterize" the canvas so I do not run out of memory? I do not need to zoom and pan around the image, it is going straight to disk. I realize that I can bin the data and plot that, but I'm not sure how to do this with a custom colormap *and* an alpha value.