You could always pyimport pyplot directly, without using the PyPlot package. (The main reason for PyPlot is to set up the GUI, although I agree that it should allow more flexibility regarding the backend.) i.e.
pyimport("matplotlib")[:use]("Agg") @pyimport matplotlib.pyplot as plt plt.plot(1:10)