Thanks to all for the suggestions. While Matt's answer works, it forces the user to wait between clicks whereas Paulo's answer allows the user to click at will and provides them with a smoother experience regardless. Also, I found that adding 'drawnow' at the end of the image generation code made that function a lot more responsive, which alone fixed the problem for small to moderately sized data sets.