Perhaps you can try to use Py-Plot's object-oriented environment, by substituting as follows:
import matplotlib.pyplot as plt
import numpy as np
xs = np.array([100, 500])
ys = np.array([300, 800])
fig, ax = plt.subplots() ax.plot(xs,ys)
I dont know if it will help you, but I have also had trouble with my graphs coming out all ascii-art like.