Skip to content
Snippets Groups Projects
Commit b5ec7b3c authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Squashed 'moose-examples/' changes from 6e8a629e3..bd41d0688

bd41d0688 Wait for user to press button before quiting displaying plots. Use matplotlib.pyplot instead of pylab.

git-subtree-dir: moose-examples
git-subtree-split: bd41d068806ceba8e0ded0c73da536415aaeebd4
parent d07f7ea6
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@
# You may also find in interesting to change the volume.
import math
import pylab
import matplotlib.pyplot as plt
import numpy
import moose
import sys
......@@ -87,12 +87,14 @@ def makeModel():
moose.useClock( 4, '/model/compartment/##', 'process' )
moose.useClock( 8, '/model/graphs/#', 'process' )
def displayPlots():
print( 'Displaying plots' )
for x in moose.wildcardFind( '/model/graphs/conc#' ):
t = numpy.arange( 0, x.vector.size, 1 ) #sec
pylab.plot( t, x.vector, label=x.name )
pylab.legend()
pylab.show()
plt.plot( t, x.vector, label=x.name )
plt.legend()
plt.show()
def main():
solver = "gsl"
......@@ -132,8 +134,8 @@ def main():
# Iterate through all plots, dump their contents to data.plot.
displayPlots()
raw_input( 'Press any key to quit' )
quit()
# Run the 'main' if this script is executed standalone.
if __name__ == '__main__':
......
......@@ -8,5 +8,4 @@ rdes.buildModel()
moose.reinit()
moose.start( 0.3 )
rdes.display()
rdes.display()
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment