Ignore:
Timestamp:
Oct 27, 2011, 8:23:34 PM (14 years ago)
Author:
steve
Message:

Got the ctac figures working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py

    r8240 r8241  
    151151    def initialize_plotting(self,
    152152                            stage_lim = [-1.0, 40.0],
    153                             height_lim = [-1.0, 10.0],
     153                            width_lim = [-1.0, 10.0],
    154154                            velocity_lim = [-5.0, 5.0]):
    155155
     
    159159
    160160        x = self.get_vertices().flatten()
     161
    161162        z = self.quantities['elevation'].vertex_values.flatten()
    162163        w = self.quantities['stage'].vertex_values.flatten()
    163164        h = self.quantities['height'].vertex_values.flatten()
    164165        v = self.quantities['velocity'].vertex_values.flatten()
     166        b = self.quantities['width'].vertex_values.flatten()
    165167
    166168        print x.shape
    167169        print z.shape
    168170
     171        #-------------------------------
     172        # Top plot
     173        #-------------------------------
    169174        self.plot1 = pylab.subplot(311)
    170175
     
    173178
    174179        self.plot1.set_ylim(stage_lim)
    175         pylab.xlabel('Position')
     180        #pylab.xlabel('Position')
    176181        pylab.ylabel('Stage')
    177182
     183        #-------------------------------
     184        # Middle Plot
     185        #-------------------------------
    178186        self.plot2 = pylab.subplot(312)
    179187
    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        #-------------------------------
    186197        self.plot3 = pylab.subplot(313)
    187198
     
    203214        h = self.quantities['height'].vertex_values.flatten()
    204215        v = self.quantities['velocity'].vertex_values.flatten()
     216        b = self.quantities['width'].vertex_values.flatten()
    205217
    206218
    207219        self.zplot.set_ydata(z)
    208220        self.wplot.set_ydata(w)
    209         self.hplot.set_ydata(h)
     221        self.bplot.set_ydata(b)
    210222        self.vplot.set_ydata(v)
    211223
     
    213225
    214226
    215     def hold_plotting(self):
     227    def hold_plotting(self,save=None):
    216228
    217229        self.update_plotting()
     
    219231       
    220232        pylab.ioff()
     233
     234        if save != None:
     235            file = save+".pdf"
     236            pylab.savefig(file)
    221237
    222238        pylab.show()
     
    287303    w_C[:] = h_C + z_C
    288304
    289     print w_C
     305    #print w_C
    290306
    291307    # Extrapolate velocity and stage as well as channel geometry.
Note: See TracChangeset for help on using the changeset viewer.