99
1010# plot an output file using the solver's dovis script
1111
12- def makeplot (myd , solverName , outfile ):
12+ def makeplot (myd , solverName , outfile , W , H ):
1313
1414 exec 'import ' + solverName + ' as solver'
1515
1616 sim = solver .Simulation (None , None )
1717 sim .cc_data = myd
1818
19- pylab .figure (num = 1 , figsize = (8 , 4.5 ), dpi = 100 , facecolor = 'w' )
19+ pylab .figure (num = 1 , figsize = (W , H ), dpi = 100 , facecolor = 'w' )
2020
2121 sim .dovis ()
2222 pylab .savefig (outfile )
@@ -35,23 +35,30 @@ def usage():
3535 -h, --help show this help message and exit
3636 -o image.png output image name. The extension .png will generate a PNG
3737 file, .eps will generate an EPS file (default: plot.png).
38+ -W width width in inches
39+ -H height height in inches
3840"""
3941 print usage
4042 sys .exit ()
4143
4244
4345if __name__ == "__main__" :
4446
45- try : opts , next = getopt .getopt (sys .argv [1 :], "o:h" )
47+ try : opts , next = getopt .getopt (sys .argv [1 :], "o:h:W:H: " )
4648 except getopt .GetoptError :
4749 sys .exit ("invalid calling sequence" )
4850
4951 outfile = "plot.png"
5052
53+ W = 8.0
54+ H = 4.5
55+
5156 for o , a in opts :
5257 if o == "-h" : usage ()
5358 if o == "-o" : outfile = a
54-
59+ if o == "-W" : W = float (a )
60+ if o == "-H" : H = float (a )
61+
5562 try : solver = next [0 ]
5663 except : usage ()
5764
@@ -60,7 +67,7 @@ def usage():
6067
6168 myg , myd = patch .read (file )
6269
63- makeplot (myd , solver , outfile )
70+ makeplot (myd , solver , outfile , W , H )
6471
6572
6673
0 commit comments