I want to plot some functions that I defined for my models.
I did the following but there is probably a better way:
#!/usr/bin/env python3 import matplotlib.pyplot as plt from brian2 import run, NeuronGroup, StateMonitor, defaultclock from brian2 import second group = NeuronGroup(1, "x = (t/second - 100)**2 : 1", method='euler') statemon = StateMonitor(group, ['x'], record=True) defaultclock.dt = 0.1*second run(200*second) plt.plot(statemon.t/second-100, statemon.x) plt.xlabel('x') plt.ylabel('x*x') plt.savefig("brian_plotting.png")
Can you please point me to the correct way to plot equations used in Brian2?
Thanks in advance,