Last change
on this file since 20500 was 20500, checked in by Mathieu Morlighem, 9 years ago |
merged trunk-jpl and trunk for revision 20497
|
File size:
955 bytes
|
Line | |
---|
1 | from expread import expread
|
---|
2 | import numpy as npy
|
---|
3 |
|
---|
4 | def expdisp(domainoutline,ax,linestyle='--k',linewidth=1,unitmultiplier=1.):
|
---|
5 | '''
|
---|
6 | plot the contents of a domain outline file
|
---|
7 |
|
---|
8 | This routine reads in a domain outline file and plots all of the x,y contours
|
---|
9 |
|
---|
10 | 'ax' is a handle to the current plot axes, onto which the contours are to be drawn
|
---|
11 |
|
---|
12 | Usage:
|
---|
13 | expdisp(domainoutline,ax)
|
---|
14 |
|
---|
15 | Example:
|
---|
16 | expdisp('domain.exp',plt.gca(),linestyle='--k',linewidth=2,unitmultiplier=1.e3)
|
---|
17 | '''
|
---|
18 |
|
---|
19 | domain=expread(domainoutline)
|
---|
20 |
|
---|
21 | for i in xrange(len(domain)):
|
---|
22 | if domain[i]['nods']==1:
|
---|
23 | ax.plot(domain[i]['x']*unitmultiplier,domain[i]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10)
|
---|
24 | else:
|
---|
25 | x=domain[i]['x'].tolist() # since expread returns a string representation of the arrays
|
---|
26 | y=domain[i]['y'].tolist()
|
---|
27 | ax.plot(x*unitmultiplier,y*unitmultiplier,linestyle,linewidth=linewidth)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.