Import pylab only when plotting is requested