- Timestamp:
- Oct 27, 2011, 8:23:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py
r8240 r8241 151 151 def initialize_plotting(self, 152 152 stage_lim = [-1.0, 40.0], 153 height_lim = [-1.0, 10.0],153 width_lim = [-1.0, 10.0], 154 154 velocity_lim = [-5.0, 5.0]): 155 155 … … 159 159 160 160 x = self.get_vertices().flatten() 161 161 162 z = self.quantities['elevation'].vertex_values.flatten() 162 163 w = self.quantities['stage'].vertex_values.flatten() 163 164 h = self.quantities['height'].vertex_values.flatten() 164 165 v = self.quantities['velocity'].vertex_values.flatten() 166 b = self.quantities['width'].vertex_values.flatten() 165 167 166 168 print x.shape 167 169 print z.shape 168 170 171 #------------------------------- 172 # Top plot 173 #------------------------------- 169 174 self.plot1 = pylab.subplot(311) 170 175 … … 173 178 174 179 self.plot1.set_ylim(stage_lim) 175 pylab.xlabel('Position')180 #pylab.xlabel('Position') 176 181 pylab.ylabel('Stage') 177 182 183 #------------------------------- 184 # Middle Plot 185 #------------------------------- 178 186 self.plot2 = pylab.subplot(312) 179 187 180 self.hplot, = pylab.plot(x, h) 181 182 self.plot2.set_ylim(height_lim) 183 pylab.xlabel('Position') 184 pylab.ylabel('Height') 185 188 self.bplot, = pylab.plot(x, b) 189 190 self.plot2.set_ylim(width_lim) 191 #pylab.xlabel('Position') 192 pylab.ylabel('Width') 193 194 #------------------------------- 195 # Bottom Plot 196 #------------------------------- 186 197 self.plot3 = pylab.subplot(313) 187 198 … … 203 214 h = self.quantities['height'].vertex_values.flatten() 204 215 v = self.quantities['velocity'].vertex_values.flatten() 216 b = self.quantities['width'].vertex_values.flatten() 205 217 206 218 207 219 self.zplot.set_ydata(z) 208 220 self.wplot.set_ydata(w) 209 self. hplot.set_ydata(h)221 self.bplot.set_ydata(b) 210 222 self.vplot.set_ydata(v) 211 223 … … 213 225 214 226 215 def hold_plotting(self ):227 def hold_plotting(self,save=None): 216 228 217 229 self.update_plotting() … … 219 231 220 232 pylab.ioff() 233 234 if save != None: 235 file = save+".pdf" 236 pylab.savefig(file) 221 237 222 238 pylab.show() … … 287 303 w_C[:] = h_C + z_C 288 304 289 print w_C305 #print w_C 290 306 291 307 # Extrapolate velocity and stage as well as channel geometry.
Note: See TracChangeset
for help on using the changeset viewer.