• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python mlab.title函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mayavi.mlab.title函数的典型用法代码示例。如果您正苦于以下问题:Python title函数的具体用法?Python title怎么用?Python title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了title函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: plotSpherical

def plotSpherical(dataset, vertices, triangles, ptitle="", tsize=0.4, theight=0.95):
    """Plot the spherical data given a data set, triangle set and vertex set.

    The vertex set defines the direction cosines of the individual samples.
    The triangle set defines how the surfrace must be structured between the samples.
    The data set defines, for each direction cosine, the length of the vector.

    Args:
        | dataset(numpy.array(double)): array of data set values
        | vertices(numpy.array([])): array of direction cosine vertices as [x y z]
        | triangles(numpy.array([])): array of triangles as []
        | ptitle(string): title or header for this display
        | tsize(double): title size (units not quite clear)
        | theight(double): title height (y value) (units not quite clear)

    Returns:
        | provides and mlab figure.

    Raises:
        | No exception is raised.
"""

    # calculate a (x,y,z) data set from the direction vectors
    x = dataset * vertices[:, 0]
    y = dataset * vertices[:, 1]
    z = dataset * vertices[:, 2]

    mlab.figure(1, fgcolor=(0, 0, 0), bgcolor=(1, 1, 1))

    # Visualize the points
    pts = mlab.triangular_mesh(x, y, z, triangles)  # z, scale_mode='none', scale_factor=0.2)
    mlab.title(ptitle, size=tsize, height=theight)
    mlab.show()
开发者ID:sukharev,项目名称:ucd,代码行数:33,代码来源:ryplotspherical.py


示例2: show_contrasts

def show_contrasts(subject, contrasts, side, threshold):

    x, y, z, triangles = get_geometry(subject, side, "inflated")   ## inflated or white
    curv = get_curvature_sign(subject, side)

    f = mlab.figure()
    mlab.clf()

    # anatomical mesh
    mlab.triangular_mesh(x, y, z, triangles, transparent=False,
                         opacity=1., name=subject,
        scalars=curv, colormap="bone", vmin=-1, vmax=2)

    mlab.title(subject)

    cmaps = [colormaps[c.split("-")[0]]['colormap'] for c in contrasts]

    for contrast, colormap in zip(contrasts, cmaps):
        # functional mesh
        data = get_contrast(subject, contrast, side)
        func_mesh = mlab.pipeline.triangular_mesh_source(x, y, z, triangles,
                                                     scalars=data)
            # threshold
        thresh = mlab.pipeline.threshold(func_mesh, low=threshold)

        surf = mlab.pipeline.surface(thresh, colormap='hot', transparent=True,
                          opacity=.8) # diminuer pour avoir plus de transparence
        lut = (np.array([colormap(v) for v in np.linspace(.25, 1., 256)]) * 255
                       ).astype(int)

        surf.module_manager.scalar_lut_manager.lut.table = lut

    mlab.draw()

    return f
开发者ID:bthirion,项目名称:mathematicians,代码行数:35,代码来源:marie_ventral_mosaic.py


示例3: plot_trajectory

def plot_trajectory(perf_data, stimset, stim_class, symbols, post_stim_time=1):
        
    net = perf_data.net
    net.noise_std = 0.0
        
        
    mlab.figure(bgcolor=(0.5, 0.5, 0.5), fgcolor=(0.0, 0.0, 0.0))
    for symbol in symbols:
        stim_md5 = stimset.symbol_to_md5[symbol][0]
        stim = stimset.all_stims[stim_md5]
        net_sims = run_sim(net, {stim_md5:stim},
                           burn_time=100,
                           pre_stim_time = 1,
                           post_stim_time=max(25, post_stim_time),
                           num_trials=1)
        
        sim = net_sims[stim_md5]
        avg_resp = sim.responses[0, :, :].squeeze()
        stim_start = 0
        record_time = len(stim) + 1
        stim_end = len(stim) + post_stim_time
        
        stimsym = stimset.md5_to_symbol[stim_md5]
        #stim_str = '%s:%s (%0.2f)' % (stimsym, ''.join(['%d' % s for s in stim]), perf_data.logit_perf)
        stim_str = '%s:%s' % (stimsym, ''.join(['%d' % s for s in stim]))
    
        t = np.arange(0, stim_end)
        traj = mlab.plot3d(avg_resp[0:stim_end, 0], avg_resp[0:stim_end, 1], avg_resp[0:stim_end, 2], t,
                           colormap='hot', tube_radius=None)
        #mlab.points3d(avg_resp[stim_start, 0], avg_resp[stim_start, 1], avg_resp[stim_start, 2], scale_factor=0.300)
        mlab.points3d(avg_resp[record_time-1, 0], avg_resp[record_time-1, 1], avg_resp[record_time-1, 2], scale_factor=0.900)
    
    mlab.colorbar()
    if len(symbols) == 1:
        mlab.title(stim_str)
开发者ID:mschachter,项目名称:prorn,代码行数:35,代码来源:plot.py


示例4: action

    def action(u, x, xv, y, yv, t, n):
        #print 'action, t=',t,'\nu=',u, '\Nx=',x, '\Ny=', y
        if plot == 1:
            mesh(xv, yv, u, title='t=%g' %t[n])
            time.sleep(0.2) # pause between frames

        elif plot == 2:
            # mayavi plotting
            mlab.clf()
            extent1 = (0, 20, 0, 20,-2, 2)
            s = mlab.surf(x , y, u, colormap='Blues', warp_scale=5,extent=extent1)
            mlab.axes(s, color=(.7, .7, .7), extent=extent1,
            ranges=(0, 10, 0, 10, -1, 1), xlabel='', ylabel='',
            zlabel='',
            x_axis_visibility=False, z_axis_visibility=False)
            mlab.outline(s, color=(0.7, .7, .7), extent=extent1)
            mlab.text(2, -2.5, '', z=-4, width=0.1)
            mlab.colorbar(object=None, title=None, orientation='horizontal', nb_labels=None, nb_colors=None, label_fmt=None)
            mlab.title('test 1D t=%g' % t[n])

            mlab.view(142, -72, 50)
            f = mlab.gcf()
            camera = f.scene.camera
            camera.yaw(0)
        
        
        if plot > 0:
            path = 'Figures_wave2D'
            time.sleep(0) # pause between frames
            if save_plot and plot != 2:
                filename = '%s/%08d.png' % (path, n)
                savefig(filename)  # time consuming!
            elif save_plot and plot == 2:
                filename = '%s/%08d.png' % (path,n)
                mlab.savefig(filename)  # time consuming!
开发者ID:yellowsimulator,项目名称:Blender,代码行数:35,代码来源:wave2D.py


示例5: Render

    def Render(self):
        
        t1clock = clock()                    
        self.figure = mlab.figure(bgcolor = (1, 1, 1), fgcolor = (0, 0, 0))#, figure = dataset.class_name[3:])
        self.figure.scene.disable_render = True
        nodesToRender = self.leafCount
        if self.renderToLevel != -1:
            nodesToRender = 0
            for i in range(0, self.renderToLevel):
                nodesToRender += self.nodesPerLevel[i]
            
        vertices = array(zeros((nodesToRender*8, 3)))
        facets = array(zeros((nodesToRender *6, 4)))
        self.centroids = array(zeros((nodesToRender , 3)))                
        self.root.Render(self.renderToLevel, vertices, facets, self.centroids, render_points = False)
        
        
        # Print vertices
        # Print facets
        if self.renderVerticesAndFacets:
            dataset = tvtk.PolyData(points = vertices, polys = facets)
            surf = mlab.pipeline.surface(dataset, opacity = .001)            
            mlab.pipeline.surface(mlab.pipeline.extract_edges(surf), color = (0, 0, 0))
            
            #print 'len 111 = ', len(vertices)
            #print 'len 222 = ', len(facets)
            #print 'Rendering took ', clock() - t1clock
                    
        if self.renderCentroids:
            print 'self.leafCount = ', self.leafCount
            scalars = array(ones(self.leafCount)) * 0.05
            self.centroid_glyphs =  mlab.points3d(self.centroids[:, 0], self.centroids[:, 1], self.centroids[:, 2], scalars, scale_factor=.05, color = (1, 0, 0))#, s, color = (1, 0, 0), )
            
#        outline = mlab.outline(name = str('1'), line_width = 3, color = (0, 1, 0))
#        outline.outline_mode = 'full'        
#        center = self.leaves[0].center
#        radius = self.leaves[0].radius
#        print 'center = ', center
#        print 'radius= ', radius
#        outline.bounds = (center[0] - radius, center[0] + radius,
#                          center[1] - radius, center[1] + radius,
#                          center[2] - radius, center[2] + radius)        

        # temp - rendering points                
        self.RenderPoints()
        
        self.RenderOctreeGraph()   
                        
        mlab.title('Click on centroid')
                        
        picker = self.figure.on_mouse_pick(self.picker_callback)
        # Decrease the tolerance, so that we can more easily select a precise
        # point.
        picker.tolerance = 0.01
        
        self.figure.scene.disable_render = False
        
        # Here, we grab the points describing the individual glyph, to figure
        # out how many points are in an individual glyph.
        self.glyph_points = self.centroid_glyphs.glyph.glyph_source.glyph_source.output.points.to_array()
开发者ID:mikahirsch,项目名称:skeletonization,代码行数:60,代码来源:octree.py


示例6: plot_u

    def plot_u(u, x, xv, y, yv, t, n):
        """User action function for plotting."""
        if t[n] == 0:
            time.sleep(2)
        if plot_method == 1:
            # Works well with Gnuplot backend, not with Matplotlib
            st.mesh(x, y, u, title='t=%g' % t[n], zlim=[-1,1],
                    caxis=[-1,1])
        elif plot_method == 2:
            # Works well with Gnuplot backend, not with Matplotlib
            st.surfc(xv, yv, u, title='t=%g' % t[n], zlim=[-1, 1],
                  colorbar=True, colormap=st.hot(), caxis=[-1,1],
                  shading='flat')
        elif plot_method == 3:
            print 'Experimental 3D matplotlib...under development...'
            # Probably too slow
            #plt.clf()
            ax = fig.add_subplot(111, projection='3d')
            u_surf = ax.plot_surface(xv, yv, u, alpha=0.3)
            #ax.contourf(xv, yv, u, zdir='z', offset=-100, cmap=cm.coolwarm)
            #ax.set_zlim(-1, 1)
            # Remove old surface before drawing
            if u_surf is not None:
                ax.collections.remove(u_surf)
            plt.draw()
            time.sleep(1)
        elif plot_method == 4:
	    # Mayavi visualization
            mlab.clf()
            extent1 = (0, 20, 0, 20,-2, 2)
            s = mlab.surf(x , y, u,
                          colormap='Blues',
                          warp_scale=5,extent=extent1)
            mlab.axes(s, color=(.7, .7, .7), extent=extent1,
                      ranges=(0, 10, 0, 10, -1, 1),
                      xlabel='', ylabel='', zlabel='',
                      x_axis_visibility=False,
                      z_axis_visibility=False)
            mlab.outline(s, color=(0.7, .7, .7), extent=extent1)
            mlab.text(6, -2.5, '', z=-4, width=0.14)
            mlab.colorbar(object=None, title=None,
                          orientation='horizontal',
                          nb_labels=None, nb_colors=None,
                          label_fmt=None)
            mlab.title('Gaussian t=%g' % t[n])
            mlab.view(142, -72, 50)
            f = mlab.gcf()
            camera = f.scene.camera
            camera.yaw(0)

        if plot_method > 0:
            time.sleep(0) # pause between frames
            if save_plot:
                filename = 'tmp_%04d.png' % n
		if plot_method == 4:
                    mlab.savefig(filename)  # time consuming!
		elif plot_method in (1,2):
                    st.savefig(filename)  # time consuming!
开发者ID:hplgit,项目名称:fdm-book,代码行数:58,代码来源:wave2D_u0.py


示例7: _populate_scene

    def _populate_scene(self, scene, title):
        trajectories = self.data.root.positions.read()[:, :self.end, :]
        self.plot_uav_trajectories(trajectories, figure=scene.mayavi_scene)

        area = self.conf['area']
        scene.mayavi_scene.children[0].add_child(
            Outline(manual_bounds=True, bounds=area.flatten()))

        if not self.plain:
            mlab.title(title, figure=scene.mayavi_scene)
开发者ID:jgosmann,项目名称:plume,代码行数:10,代码来源:visualize.py


示例8: test_text

 def test_text(self):
     """ Test the text module.
     """
     data = np.random.random((3, 3, 3))
     src = mlab.pipeline.scalar_field(data)
     # Some smoke testing
     mlab.text(0.1, 0.9, 'foo')
     mlab.text(3, 3, 'foo', z=3)
     mlab.title('foo')
     # Check that specifying 2D positions larger than 1 raises an
     # error
     self.assertRaises(ValueError, mlab.text, 0, 1.5, 'test')
开发者ID:enthought,项目名称:mayavi,代码行数:12,代码来源:test_mlab_integration.py


示例9: plot_graphs

def plot_graphs(locs,stations,nbsta,CLUSTER,nbmin,threshold):
  from mayavi import mlab

  # Event coordinates
  stack_x,stack_y,stack_z=[],[],[]
  for loc in locs:
    stack_x.append(loc['x_mean'])
    stack_y.append(loc['y_mean'])
    stack_z.append(-loc['z_mean'])

  # Extract coordinates
  xsta,ysta,zsta=[],[],[]
  for sta in sorted(stations):
    xsta.append(stations[sta]['x'])
    ysta.append(stations[sta]['y'])
    zsta.append(stations[sta]['elev'])

  # 3D PLOT USING MAYAVI
  logging.info("Plotting...")
  s1=mlab.figure(1,bgcolor=(1,1,1),fgcolor=(0,0,0),size=(1000,900))
  s1=mlab.points3d(xsta,ysta,zsta,color=(1,0,0),scale_factor=0.05,mode='cube')
  s1=mlab.axes(extent=[362,370,7647,7653,-0.5,2.5],color=(0,0,0))
  s1=mlab.outline(extent=[362,370,7647,7653,-0.5,2.5],color=(0,0,0))
  s1=mlab.points3d(stack_x,stack_y,stack_z,scale_factor=0.1,color=(0.8,0.8,0.8))
  s1=mlab.title("threshold=%s, nbmin=%s"%(threshold,nbmin),height=0.1,size=0.35,color=(0,0,0))
  for i_ev in range(len(nbsta)):
    for i_c in range(1,len(CLUSTER)+1):
      if i_ev+1 in CLUSTER[i_c]:
        s1=mlab.points3d(stack_x[i_ev],stack_y[i_ev],stack_z[i_ev],scale_factor=0.1,color=tuple(CZ_Clust_2_color(100*(len(CLUSTER)-i_c)/len(CLUSTER))))
        s1=mlab.text3d(stack_x[i_ev],stack_y[i_ev],stack_z[i_ev],str(i_c),color=(0,0,0),scale=0.1)
  logging.info("Done!")
   
  logging.info("Plotting...")
  s2=mlab.figure(2,bgcolor=(1,1,1),fgcolor=(0,0,0),size=(1000,900))
  mlab.points3d(xsta,ysta,zsta,color=(1,0,0),scale_factor=0.05,mode='cube')
  mlab.axes(extent=[362,370,7647,7653,-0.5,2.5],color=(0,0,0))
  mlab.outline(extent=[362,370,7647,7653,-0.5,2.5],color=(0,0,0))
  mlab.points3d(stack_x,stack_y,stack_z,scale_factor=0.1,color=(0.8,0.8,0.8))
  mlab.title("threshold=%s, nbmin=%s"%(threshold,nbmin),height=0.1,size=0.35,color=(0,0,0))
  for ind_I in range(len(nbsta)):
    for ind_J in range(ind_I+1,len(nbsta)):
      W_IJ=nbsta[ind_I,ind_J]
      if W_IJ >= nbmin:
        mlab.points3d(stack_x[ind_J],stack_y[ind_J],stack_z[ind_J],scale_factor=0.1,color=(0,0,0))
        mlab.points3d(stack_x[ind_I],stack_y[ind_I],stack_z[ind_I],scale_factor=0.1,color=(0,0,0))
        d=(stack_x[ind_J]-stack_x[ind_I],stack_y[ind_J]-stack_y[ind_I],stack_z[ind_J]-stack_z[ind_I])
        norm=np.sqrt(d[0]**2+d[1]**2+d[2]**2)
        s2=mlab.quiver3d(stack_x[ind_I],stack_y[ind_I],stack_z[ind_I],d[0],d[1],d[2],color=tuple(CZ_W_2_color(W_IJ)),mode='2ddash',scale_factor=norm,scale_mode='scalar')
  #mlab.colorbar(s2)
  logging.info("Done!")
  mlab.show()
开发者ID:ablkvo,项目名称:waveloc,代码行数:51,代码来源:clustering.py


示例10: analyze

def analyze():
    mcs = []
    import mayavi.mlab as mlab
    
    for gamma_b in linspace(2*pi*1e3, 2*pi*17e3, 5):
        mc = MonteCarlo()
        mc.run_stats(35.5e-6, 0.1e-6, 300, gamma_b=gamma_b)
        mcs.append(mc)
        mlab.figure()
        mlab.barchart(mc.cov)
        mlab.axes()
        mlab.title("gamma_b/2pi = "+str(gamma_b/(2*pi)))
    return mcs
        
开发者ID:SamuelDeleglise,项目名称:qunoise,代码行数:13,代码来源:mc.py


示例11: plot_3d_barchart

 def plot_3d_barchart(self, data_dict, Type, Freq):
     ''' Using the mayavi library, plot a 3D barchart of the data of requested type, and freq.'''
 
     extent_dim = self._get_extent(3)
     Xlocs,Xlabels,Ylocs,Ylabels = self._get_ticks(5,5,extent_dim)
     data = self.get_data_type(data_dict, Type)
     v_min,v_max = self.get_data_scale(data_dict, Type)
     freq_array = data_dict['freq']
     freq_ind = self.get_nearest_freq(freq_array,Freq)
     
     from mayavi import mlab
     mlab.figure( bgcolor=(0.5,0.5,0.5) )# grey bg
     mlab.barchart(data[freq_ind,:,:],vmin=v_min,vmax=v_max,auto_scale=False,colormap='jet',extent = extent_dim)
     mlab.title('Freq %.3e' %freq_array[freq_ind],size=5,height=0.1)
     mlab.show()
开发者ID:toomanycats,项目名称:XY_table,代码行数:15,代码来源:code_tools.py


示例12: animation

 def animation():
     for i in count():
         frame = i % all_verts.shape[2]
         verts = all_verts[:, :, frame].T
         mlab.clf()
         mlab.triangular_mesh(
             verts[:, 0],
             verts[:, 1],
             verts[:, 2],
             faces,
             color=(.9, .7, .7))
         fig.scene.z_minus_view()
         mlab.view(azimuth=180)
         mlab.title('mesh %d' % i, size=0.5, height=0, color=(0, 0, 0))
         yield
开发者ID:mehameha998,项目名称:simplify,代码行数:15,代码来源:visualize_mesh_sequence.py


示例13: isosurface

 def isosurface(self,vv=[4.0],clim=None,**kwargs):
     """
     3D isosurfaces of scalar data
     """
     if clim==None:
         clim = [self.data.min(), self.data.max()]
     
     # Create a new scene if there isn't one
     if not self.__dict__.has_key('fig'):
         self.newscene()
     
     # Convert the cell centred data into a scene source
     # Need to set use point (vertex) data
     src = mlab.pipeline.cell_to_point_data(self.ug)
     
     # Add the iso_surface module to the scene
     self.h=mlab.pipeline.iso_surface(src,contours=vv,line_width=1.0,vmin=clim[0],vmax=clim[1],**kwargs)
     
     # Add a colorbar if the isn't one
     if not self.__dict__.has_key('cb'):
         self.colorbar() 
         
     # Add a title if there isn't one
     if not self.__dict__.has_key('title'):
         self.title=mlab.title(self._SpatialgenTitle(),height=0.95,size=0.15)
开发者ID:mrayson,项目名称:soda,代码行数:25,代码来源:suntvtk.py


示例14: contour

 def contour(self,vv=[10],clim=None,**kwargs):
     """
     Filled contour plot of scalar data
     """
     
     if clim==None:
         clim = [self.data.min(), self.data.max()]
     
     # Create a new scene if there isn't one
     if not self.__dict__.has_key('fig'):
         self.newscene()
     
     # Need to set use point (vertex) data
     src = mlab.pipeline.cell_to_point_data(self.ug)
     
     # Add the contour_surface module to the scene
     self.h=mlab.pipeline.contour_surface(src,contours=vv,line_width=1.0,vmax=clim[1],vmin=clim[0],**kwargs)
     self.h.contour.filled_contours=True # This is the trick to fill the contours
     
     # Add a colorbar if the isn't one
     if not self.__dict__.has_key('cb'):
         self.colorbar() 
         
     # Add a title if there isn't one
     if not self.__dict__.has_key('title'):
         self.title=mlab.title(self._SpatialgenTitle(),height=0.95,size=0.15)
开发者ID:mrayson,项目名称:soda,代码行数:26,代码来源:suntvtk.py


示例15: volume

 def volume(self,clim=None,**kwargs):
     """
     3D volumetric plot of scalar data
     
     **Warning** This is really slow and memory hungry!
     """
     if self.clim==None:
         self.clim = [self.data.min(), self.data.max()]
     
     # Create a new scene if there isn't one
     if not self.__dict__.has_key('fig'):
         self.newscene()
     
     # Convert the cell centred data into a scene source
     # Need to set use point (vertex) data
     src = mlab.pipeline.cell_to_point_data(self.ug)
     
     # Add the volume module to the scene
     self.h=mlab.pipeline.volume(src,**kwargs)
     
     # Add a colorbar if the isn't one
     if not self.__dict__.has_key('cb'):
         self.colorbar() 
         
     # Add a title if there isn't one
     if not self.__dict__.has_key('title'):
         self.title=mlab.title(self._SpatialgenTitle(),height=0.95,size=0.15)
开发者ID:mrayson,项目名称:soda,代码行数:27,代码来源:suntvtk.py


示例16: plot_u

 def plot_u(u, x, xv, y, yv, t, n):
     print " ploting"
     if t[n] == 0:
         time.sleep(2)
     if plot_method == 1:
         mesh(x, y, u, title='t=%g' % t[n], zlim=[-1,1],
              caxis=[-1,1])
     elif plot_method == 2:
         surfc(xv, yv, u, title='t=%g' % t[n], zlim=[-1, 1],
               colorbar=True, colormap=hot(), caxis=[-1,1],
               shading='flat')
     elif plot_method == 3:
         # mayavi plotting
         mlab.clf()
         extent1 = (0, 20, 0, 20,-2, 2)
         s = mlab.surf(x , y, u, colormap='Blues', warp_scale=5,
                      extent=extent1)
         mlab.axes(s, color=(.7, .7, .7), extent=extent1,
         ranges=(0, 10, 0, 10, -1, 1), xlabel='', ylabel='',
         zlabel='',
         x_axis_visibility=False, z_axis_visibility=False)
         mlab.outline(s, color=(0.7, .7, .7), extent=extent1)
         mlab.text(2, -2.5, '', z=-4, width=0.1)
         mlab.colorbar(object=None, title=None, orientation='horizontal',
                       nb_labels=None, nb_colors=None, label_fmt=None)
         mlab.title('t=%g' % t[n])
         mlab.view(142, -72, 50)
         f = mlab.gcf()
         camera = f.scene.camera
         camera.yaw(0)
         #g = mlab.figure()
         #g.scene.movie_maker.record = True
         
     
     if plot_method > 0:
         if not os.path.exists(path):
             os.makedirs(path)
         time.sleep(0) # pause between frames
         if save_plot and plot_method == 3:
             filename = '%s/%08d.png'%(path,n)
             mlab.savefig(filename)  # time consuming!
         elif save_plot and plot_method != 3:
             filename = '%s/%08d.png'%(path,n)
             savefig(filename)  # time consuming!
开发者ID:yellowsimulator,项目名称:Blender,代码行数:44,代码来源:wave2D_full.py


示例17: title

def title(text, color=(0, 0, 0),  size=0.3, height=1):
    """
    Draw a title on a Mayavi figure.

    .. warning:: Must be called **after** you've plotted something (e.g.,
        prisms) to the figure. This is a bug.

    Parameters:

    * text : str
        The title
    * color : tuple = (r, g, b)
        RGB of the color of the text
    * size : float
        The size of the text
    * height : float
        The height where the title will be placed on the screen

    """
    _lazy_import_mlab()
    mlab.title(text, color=color, size=size, height=height)
开发者ID:fillipesiqueira,项目名称:fatiando,代码行数:21,代码来源:myv.py


示例18: t_data_plot

def t_data_plot(data,dataname,title_name,num_contours,zdr_flag=0,data_min=1.01):
    #camera1=(0.0,0.0,307.7645695540192,np.array([ 79.66195959, 74.22460988,9.96509266]))
    #camera2=(45.00000000000005,54.735610317245346,389.61669188814807,np.array([61.00005691,87.63795239,6.8619907]))
    camera3=(45.0,54.735610317245346,607.35769190957262,np.array([89.80421373,137.88978957,7.30599671]))

    size_x,size_y,size_z=data.shape
    mlab.figure(dataname,bgcolor=(1,1,1),fgcolor=(0,0,0),size=(700,600))

    if zdr_flag==1:
        fig_data=mlab.contour3d(data[:,:,:],vmin=data_min,colormap='jet')
    else:
        fig_data=mlab.contour3d(data[:,:,:],vmin=-30.0,colormap='jet')
    fig_data.contour.number_of_contours=num_contours
    fig_data.actor.property.opacity=0.4
    mlab.title(dataname)
    mlab.outline(color=(0,0,0),extent=[0,size_x,0,size_y,0,size_z])
    colorbar=mlab.colorbar(title=title_name,orientation='vertical',nb_labels=10)
    colorbar.scalar_bar_representation.position=[0.85,0.1]
    colorbar.scalar_bar_representation.position2=[0.12,0.9]
    mlab.view(*camera3)
    mlab.show()
开发者ID:qwe14789cn,项目名称:AWR-in-WRF,代码行数:21,代码来源:funlib.py


示例19: plot_time_instance

def plot_time_instance(path,t,value,var_num,plot_specs_dict):
    # make one plot at fixed time with multiple slices

    #f = mlab.figure(size=(2000,1500))
    f = mlab.figure(size=(400,300))
    file_list = value.split()
    num_eqn = int(plot_specs_dict['num_eqn'])
    
    minval = plot_specs_dict['minval'][var_num]
    maxval = plot_specs_dict['maxval'][var_num]
    for file_name in file_list:
        plot_slice(path,file_name,f,var_num,num_eqn,minval,maxval)
    mlab.title('Solution at t=' + str(t) + '\n q ' + str(var_num+1),\
                size=0.25)
    cube_range = [plot_specs_dict['domain'][0][0],  
                  plot_specs_dict['domain'][0][1],  
                  plot_specs_dict['domain'][1][0],  
                  plot_specs_dict['domain'][1][1],  
                  plot_specs_dict['domain'][2][0],  
                  plot_specs_dict['domain'][2][1]]
    mlab.axes(extent = cube_range, line_width=3.0)
    ax = mlab.colorbar(orientation='vertical')
    mlab.outline(line_width=0.02)
    #f.scene.x_minus_view()

    binary_list = [-1,1]
    for j in binary_list:
        for k in binary_list:
            for l in binary_list:
                f.scene._update_view(j, k, l, 0, 0, 0)
                save_filename = 'test_output_' + str(j) + '_'\
                                               + str(k) + '_'\
                                               + str(l) + '_'\
                                               + str(t) + '.png'
                mlab.show()
                #mlab.savefig(save_filename)
    f.scene.close()
    return None
开发者ID:dsrim,项目名称:3d_slice,代码行数:38,代码来源:plot_3d_slice.py


示例20: streammesh

    def streammesh(self,nx=30,ny=30,color=False,**kwargs):
        """
        Plots streamlines originating from points on a mesh
        """

        
        # Create a new scene if there isn't one
        if not self.__dict__.has_key('fig'):
            self.newscene()
        
        if not self.vector_overlay:
            self.loadVectorVTK()
            
        if color:
            src = mlab.pipeline.cell_to_point_data(self.ug) # This colours the streamlines by the scalar field
        else:
            src = mlab.pipeline.add_dataset(self.ug)
             
        X = np.linspace(self.xv.min(),self.xv.max(),nx)
        y0 =self.yv.min()
        y1 = self.yv.max()
        streams=[]
        for x in X:
            stream=mlab.pipeline.streamline(src,seedtype='line',**kwargs)
            stream.stream_tracer.initial_integration_step = 0.1
            stream.stream_tracer.maximum_propagation=10000.0
            stream.stream_tracer.integration_direction = 'both'
            stream.seed.widget.point1 = [x,y1,0.1]
            stream.seed.widget.point2 = [x,y0,0.1]
            stream.seed.widget.resolution = ny
            streams.append(stream)

        # Go back through and turn them off
        for stream in streams:
            stream.seed.widget.enabled = False
            
        # Add a colorbar if the isn't one
        if not self.__dict__.has_key('cb'):
            self.h=stream
            self.colorbar() 
            
        # Add a title if there isn't one
        if not self.__dict__.has_key('title'):
            self.title=mlab.title(self._SpatialgenTitle(),height=0.95,size=0.15)
         
        return streams
开发者ID:mrayson,项目名称:soda,代码行数:46,代码来源:suntvtk.py



注:本文中的mayavi.mlab.title函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mlab.triangular_mesh函数代码示例发布时间:2022-05-27
下一篇:
Python mlab.text3d函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap