diff --git a/pynest/examples/mc_neuron.py b/pynest/examples/mc_neuron.py index 05c71c20a0..161f0dc81b 100644 --- a/pynest/examples/mc_neuron.py +++ b/pynest/examples/mc_neuron.py @@ -41,8 +41,7 @@ ''' import nest -import matplotlib -import pylab as pl +import pylab nest.ResetKernel() @@ -178,22 +177,22 @@ V_m.s,V_m.p,V_m.d state for the membrane potential in soma, proximal and distal dendrites. ''' -pl.figure() -pl.subplot(211) -pl.plot(t, rec['V_m.s'], t, rec['V_m.p'], t, rec['V_m.d']) -pl.legend(('Soma', 'Proximal dendrite', 'Distal dendrite'),loc='lower right') -pl.axis([0, 1000, -76, -59]) -pl.ylabel('Membrane potential [mV]') -pl.title('Responses of iaf_cond_alpha_mc neuron') +pylab.figure() +pylab.subplot(211) +pylab.plot(t, rec['V_m.s'], t, rec['V_m.p'], t, rec['V_m.d']) +pylab.legend(('Soma', 'Proximal dendrite', 'Distal dendrite'),loc='lower right') +pylab.axis([0, 1000, -76, -59]) +pylab.ylabel('Membrane potential [mV]') +pylab.title('Responses of iaf_cond_alpha_mc neuron') ''' Plot time traces of the synaptic conductance measured in different compartments. ''' -pl.subplot(212) -pl.plot(t, rec['g_ex.s'], 'b-', t, rec['g_ex.p'], 'g-', t, rec['g_ex.d'], 'r-') -pl.plot(t, rec['g_in.s'], 'b--', t, rec['g_in.p'], 'g--', t, rec['g_in.d'], 'r--') -pl.legend(('g_ex.s', 'g_ex.p', 'g_in.d','g_in.s', 'g_in.p', 'g_in.d')) -pl.axis([350, 700, 0, 1.15]) -pl.xlabel('Time [ms]') -pl.ylabel('Synaptic conductance [nS]') +pylab.subplot(212) +pylab.plot(t, rec['g_ex.s'], 'b-', t, rec['g_ex.p'], 'g-', t, rec['g_ex.d'], 'r-') +pylab.plot(t, rec['g_in.s'], 'b--', t, rec['g_in.p'], 'g--', t, rec['g_in.d'], 'r--') +pylab.legend(('g_ex.s', 'g_ex.p', 'g_in.d','g_in.s', 'g_in.p', 'g_in.d')) +pylab.axis([350, 700, 0, 1.15]) +pylab.xlabel('Time [ms]') +pylab.ylabel('Synaptic conductance [nS]') diff --git a/pynest/examples/multimeter_file.py b/pynest/examples/multimeter_file.py index 96e168892c..19c5da28db 100644 --- a/pynest/examples/multimeter_file.py +++ b/pynest/examples/multimeter_file.py @@ -34,8 +34,8 @@ ''' import nest -import numpy as np -import pylab as pl +import numpy +import pylab nest.ResetKernel() @@ -101,9 +101,9 @@ "label": "my_multimeter"}) s_ex = nest.Create("spike_generator", - params = {"spike_times": np.array([10.0, 20.0, 50.0])}) + params = {"spike_times": numpy.array([10.0, 20.0, 50.0])}) s_in = nest.Create("spike_generator", - params = {"spike_times": np.array([15.0, 25.0, 55.0])}) + params = {"spike_times": numpy.array([15.0, 25.0, 55.0])}) ''' Next, the spike generators are connected to the neuron with `Connect`. Synapse @@ -137,16 +137,16 @@ conductance are displayed. ''' -pl.clf() +pylab.clf() -pl.subplot(211) -pl.plot(t, events["V_m"]) -pl.axis([0, 100, -75, -53]) -pl.ylabel("membrane potential (mV)") +pylab.subplot(211) +pylab.plot(t, events["V_m"]) +pylab.axis([0, 100, -75, -53]) +pylab.ylabel("membrane potential (mV)") -pl.subplot(212) -pl.plot(t, events["g_ex"], t, events["g_in"]) -pl.axis([0, 100, 0, 45]) -pl.xlabel("time (ms)") -pl.ylabel("synaptic conductance (nS)") -pl.legend(("g_exc", "g_inh")) +pylab.subplot(212) +pylab.plot(t, events["g_ex"], t, events["g_in"]) +pylab.axis([0, 100, 0, 45]) +pylab.xlabel("time (ms)") +pylab.ylabel("synaptic conductance (nS)") +pylab.legend(("g_exc", "g_inh")) diff --git a/pynest/examples/twoneurons.py b/pynest/examples/twoneurons.py index 6905b8f89c..dd43401bec 100644 --- a/pynest/examples/twoneurons.py +++ b/pynest/examples/twoneurons.py @@ -19,8 +19,6 @@ # You should have received a copy of the GNU General Public License # along with NEST. If not, see . -import matplotlib -# matplotlib.use("macosx") import pylab import nest diff --git a/pynest/examples/vinit_example.py b/pynest/examples/vinit_example.py index 6f5a0f7cbe..6770892481 100755 --- a/pynest/examples/vinit_example.py +++ b/pynest/examples/vinit_example.py @@ -33,7 +33,7 @@ import nest import numpy -import pylab as pl +import pylab ''' A loop runs over a range of initial membrane voltages. @@ -79,12 +79,12 @@ t = nest.GetStatus(voltmeter,"events")[0]["times"] v = nest.GetStatus(voltmeter,"events")[0]["V_m"] - pl.plot(t, v, label="initial V_m = %.2f mV" % vinit) + pylab.plot(t, v, label="initial V_m = %.2f mV" % vinit) ''' Set the legend and the labels for the plot outside of the loop. ''' -pl.legend(loc=4) -pl.xlabel("time (ms)") -pl.ylabel("V_m (mV)") +pylab.legend(loc=4) +pylab.xlabel("time (ms)") +pylab.ylabel("V_m (mV)") diff --git a/pynest/nest/tests/test_connect_helpers.py b/pynest/nest/tests/test_connect_helpers.py index 5d701d8319..ea6bb22925 100644 --- a/pynest/nest/tests/test_connect_helpers.py +++ b/pynest/nest/tests/test_connect_helpers.py @@ -22,7 +22,6 @@ import numpy as np import scipy.stats import nest -import matplotlib.pylab as plt from scipy.stats import truncexpon try: