Changeset 1054 for trunk/UTIL
- Timestamp:
- Sep 27, 2013, 3:48:25 AM (11 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/pp.py
r1050 r1054 71 71 parser.add_option('-V','--void',action='store_true',dest='void',default=False,help="no colorbar, no title, no labels") 72 72 parser.add_option('-U','--units',action='append',dest='units',type="string",default=None,help="units for the field") 73 parser.add_option('-F','--fmt',action='append',dest='fmt',type="string",default=None,help="values formatting. ex: '%.0f' '%3.1e'") 73 74 # -- 1D plot 74 75 parser.add_option('-L','--linestyle',action='append',dest='linestyle',type="string",default=None,help="[1D] linestyle: '-' '--' '.' '..'") -
trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
r1050 r1054 56 56 except: pass 57 57 print output ; output = "" 58 59 # request a given attribute (and test if it is here) 60 def ncattr(filename,char): 61 nc = netCDF4.Dataset(filename) 62 if hasattr(nc,char): ncattr=getattr(nc,char) 63 return ncattr 58 64 59 65 # check a tab and exit if wrong. if just one string make it a list. … … 164 170 savtxt=False,\ 165 171 modx=None,\ 172 fmt=None,\ 166 173 xp=16,yp=8,\ 167 174 missing=1.e25,\ … … 223 230 self.xp = xp ; self.yp = yp 224 231 self.nxticks = nxticks ; self.nyticks = nyticks 232 self.fmt = fmt 225 233 226 234 # print status … … 282 290 self.missing = other.missing 283 291 self.nxticks = other.nxticks ; self.nyticks = other.nyticks 292 self.fmt = other.fmt 284 293 else: 285 294 print "!! ERROR !! argument must be a pp object." ; exit() … … 825 834 if self.nxticks is not None: plobj.nxticks = self.nxticks 826 835 if self.nyticks is not None: plobj.nyticks = self.nyticks 836 if self.fmt is not None: plobj.fmt = self.fmt 827 837 # -- 1D specific 828 838 if dp == 1: … … 1210 1220 except: 1211 1221 try: self.p[iii].modx = opt.modx[0] 1222 except: pass 1223 ### 1224 try: self.p[iii].fmt = opt.fmt[iii] 1225 except: 1226 try: self.p[iii].fmt = opt.fmt[0] 1212 1227 except: pass 1213 1228 -
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r1050 r1054 815 815 objC2 = m.contour(x, y, what_I_contour, \ 816 816 zelevelsc, colors = ccol, linewidths = cline) 817 #mpl.clabel(objC2, inline=1, fontsize=10 )817 #mpl.clabel(objC2, inline=1, fontsize=10,manual=True,fmt='-%2.0f$^{\circ}$C',colors='r') 818 818 m.contourf(x, y, what_I_plot, zelevels, cmap = palette, alpha = self.trans) 819 819 ############################################################################################
Note: See TracChangeset
for help on using the changeset viewer.