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

Python pylab.isinteractive函数代码示例

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

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



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

示例1: hinton

def hinton(W, out_file=None, maxWeight=None):
    """
    Draws a Hinton diagram for visualizing a weight matrix. 
    Temporarily disables matplotlib interactive mode if it is on, 
    otherwise this takes forever.
    """
    reenable = False
    if P.isinteractive():
        P.ioff()
    P.clf()
    height, width = W.shape
    if not maxWeight:
        maxWeight = 2**N.ceil(N.log(N.max(N.abs(W)))/N.log(2))

    P.gca().set_position([0, 0, 1, 1])
    P.fill(N.array([0,width,width,0]),N.array([0,0,height,height]),'gray')
    P.axis('off')
    P.axis('equal')
    for x in xrange(width):
        for y in xrange(height):
            _x = x+1
            _y = y+1
            w = W[y,x]
            if w > 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,w/maxWeight),'white')
            elif w < 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,-w/maxWeight),'black')
    if reenable:
        P.ion()
    #P.show()
    if out_file:
        #P.savefig(out_file, format='png', bbox_inches='tight', pad_inches=0)
        fig = P.gcf()
        fig.subplots_adjust()
        fig.savefig(out_file)
开发者ID:antiface,项目名称:StarFlow,代码行数:35,代码来源:hinton.py


示例2: hinton

    def hinton(W, max_weight=None, names=(names, worst_names)):
        """
        Draws a Hinton diagram for visualizing a weight matrix.
        Temporarily disables matplotlib interactive mode if it is on,
        otherwise this takes forever.
        """
        reenable = False
        if P.isinteractive():
            P.ioff()
        P.clf()
        height, width = W.shape
        if not max_weight:
            max_weight = 2**np.ceil(np.log(np.max(np.abs(W)))/np.log(2))

        P.fill(np.array([0, width, width, 0]), np.array([0, 0, height, height]), 'gray')
        P.axis('off')
        P.axis('equal')
        cmap = plt.get_cmap('RdYlGn')
        for x in range(width):
            if names:
                plt.text(-0.5, x, names[0][x], fontsize=7, ha='right', va='bottom')
                plt.text(x, height+0.5, names[1][height-x-1], fontsize=7, va='bottom', rotation='vertical', ha='left')
            for y in range(height):
                _x = x+1
                _y = y+1
                w = W[y, x]
                if w > 0:
                    _blob(_x - 0.5, height - _y + 0.5, min(1, w/max_weight), color=cmap(w/max_weight))
                elif w < 0:
                    _blob(_x - 0.5, height - _y + 0.5, min(1, -w/max_weight), 'black')
        if reenable:
            P.ion()
        P.show()
开发者ID:slyfocks,项目名称:mtg-hypergraph,代码行数:33,代码来源:adjacency.py


示例3: plot

 def plot(self):
     fig = self._doPlot()
     if not pylab.isinteractive():
         pylab.show()
     else:
         pylab.draw()
     pylab.close(fig)
开发者ID:jcmdev0,项目名称:boomslang,代码行数:7,代码来源:PlotLayout.py


示例4: hinton

def hinton(W, maxWeight=None):
    """
    Draws a Hinton diagram for visualizing a weight matrix. 
    Temporarily disables matplotlib interactive mode if it is on, 
    otherwise this takes forever.
    """
    reenable = False
    if P.isinteractive():
        P.ioff()
    P.clf()
    height, width = W.shape
    if not maxWeight:
        maxWeight = 2**N.ceil(N.log(N.max(N.abs(W)))/N.log(2))

    P.fill(N.array([0,width,width,0]),N.array([0,0,height,height]),'gray')
    P.axis('off')
    P.axis('equal')
    for x in xrange(width):
        for y in xrange(height):
            _x = x+1
            _y = y+1
            w = W[y,x]
            if w > 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,w/maxWeight),'white')
            elif w < 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,-w/maxWeight),'black')
    if reenable:
        P.ion()
    P.show()
开发者ID:Neuroglycerin,项目名称:neukrill-net-tools,代码行数:29,代码来源:hinton_diagram.py


示例5: draw

    def draw(self, axes=None, loc=2):
        if axes == None:
            axes = p.gca()

        if self.box != None and self.box in axes.artists:
            del axes.artists[ axes.artists.index(self.box) ]
        
        #key_areas = [ mpl.offsetbox.TextArea(k, textprops=self.textprops) for k in self.datadict.keys() ]
        #val_areas = [ mpl.offsetbox.TextArea(self.datadict[k], textprops=self.textprops) for k in self.datadict.keys() ]
        key_areas = [ mpl.offsetbox.TextArea(k, textprops=self.textprops) for k in list(self.datadict.keys()) ]
        val_areas = [ mpl.offsetbox.TextArea(self.datadict[k], textprops=self.textprops) for k in list(self.datadict.keys()) ]
        
        key_vpack = mpl.offsetbox.VPacker(children=key_areas, align="left", pad=0, sep=0)
        val_vpack = mpl.offsetbox.VPacker(children=val_areas, align="right", pad=0, sep=0)
        hpack = mpl.offsetbox.HPacker(children=[key_vpack, val_vpack], align="top", pad=0,sep=4)
        
        globchildren = []
        if self.title != None:
            #titlearea = mpl.offsetbox.TextArea(self.title, textprops=self.titleprops)
            titlearea = mpl.offsetbox.TextArea(self.title)
            globchildren.append(titlearea)
        
        globchildren.append(hpack)
        globvpack = mpl.offsetbox.VPacker(children=globchildren, align="center", pad=0, sep=1)
        
        self.box = mpl.offsetbox.AnchoredOffsetbox(loc=loc, child=globvpack)
        self.box.patch.set_facecolor(self.facecolor)
        self.box.patch.set_edgecolor(self.edgecolor)
        self.box.patch.set_alpha(self.alpha)
        axes.add_artist( self.box )

        if p.isinteractive():
            p.gcf().canvas.draw()
开发者ID:IceCube-SPNO,项目名称:dashi,代码行数:33,代码来源:infobox.py


示例6: graticule

def graticule(dpar=None,dmer=None,coord=None,local=None,**kwds):
    """Create a graticule, either on an existing mollweide map or not.

    Parameters:
      - dpar, dmer: interval in degrees between meridians and between parallels
      - coord: the coordinate system of the graticule (make rotation if needed,
               using coordinate system of the map if it is defined)
      - local: True if local graticule (no rotation is performed)
    Return:
      None
    """
    f = pylab.gcf()
    wasinteractive = pylab.isinteractive()
    pylab.ioff()
    try:
        if len(f.get_axes()) == 0:
            ax=PA.HpxMollweideAxes(f,(0.02,0.05,0.96,0.9),coord=coord)
            f.add_axes(ax)
            ax.text(0.86,0.05,ax.proj.coordsysstr,fontsize=14,
                    fontweight='bold',transform=ax.transAxes)
        for ax in f.get_axes():
            if isinstance(ax,PA.SphericalProjAxes):
                ax.graticule(dpar=dpar,dmer=dmer,coord=coord,
                             local=local,**kwds)
    finally:
        pylab.draw()
        if wasinteractive:
            pylab.ion()
开发者ID:Alwnikrotikz,项目名称:healpy,代码行数:28,代码来源:visufunc.py


示例7: showslice2

def showslice2(thedata,thelabel,minval,maxval,colormap):
    theshape=thedata.shape
    numslices=theshape[0]
    ysize=theshape[1]
    xsize=theshape[2]
    slicesqrt=int(np.ceil(np.sqrt(numslices)))
    theslice=np.zeros((ysize*slicesqrt,xsize*slicesqrt))
    for i in range(0,numslices):
        ypos=int(i/slicesqrt)*ysize
        xpos=int(i%slicesqrt)*xsize
        theslice[ypos:ypos+ysize,xpos:xpos+xsize]=thedata[i,:,:]
    if P.isinteractive():
	P.ioff()
    P.axis('off')
    P.axis('equal')
    P.subplots_adjust(hspace=0.0)
    P.axes([0,0,1,1], frameon = False)
    if (colormap==0):
        thecmap=P.cm.gray
    else:
	mycmdata1 = {
	    'red'  :  ((0., 0., 0.), (0.5, 1.0, 0.0), (1., 1., 1.)),
	    'green':  ((0., 0., 0.), (0.5, 1.0, 1.0), (1., 0., 0.)),
	    'blue' :  ((0., 0., 0.), (0.5, 1.0, 0.0), (1., 0., 0.))
	    }
	thecmap = P.matplotlib.colors.LinearSegmentedColormap('mycm', mycmdata1)
	#thecmap=P.cm.spectral
    theimptr = P.imshow(theslice, vmin=minval, vmax=maxval, interpolation='nearest', label=thelabel, aspect='equal', cmap=thecmap)
    #P.colorbar()
    return()
开发者ID:bbfrederick,项目名称:stabilitycalc,代码行数:30,代码来源:stabilityfuncs.py


示例8: showlines

def showlines(vs, size=(4.1,2), **kwargs):
# {{{
  ''' 
  Plot line plots of a list of 1D variables on the same plot.

  Parameters
  ----------
  v :  list of :class:`Var`
     The variables to plot. Should all have 1 non-degenerate axis.
  '''

  Z = [v.squeeze() for v in vs]

  for z in Z:
    assert z.naxes == 1, 'Variable %s has %d non-generate axes; must have 1.' % (z.name, z.naxes)

  fig = kwargs.pop('fig', None)

  ax = wr.AxesWrapper(size=size)
  ydat = []
  for v in vs:
    vplot(v, axes=ax, label=v.name, )
    ydat.append(ax.find_plot(wr.Plot).plot_args[1])

  ylim = (np.min([np.min(y) for y in ydat]), np.max([np.max(y) for y in ydat]))
  kwargs.update(dict(ylim=ylim))
  ax.legend(loc='best', frameon=False)
  ax.setp(**kwargs)

  import pylab as pyl
  if pyl.isinteractive(): ax.render(fig)
  return ax
开发者ID:aerler,项目名称:pygeode,代码行数:32,代码来源:pyg_helpers.py


示例9: saveHintonDiagram

def saveHintonDiagram(W, directory):
    maxWeight = None
    #print "Weight: ", W
    """
    Draws a Hinton diagram for visualizing a weight matrix. 
    Temporarily disables matplotlib interactive mode if it is on, 
    otherwise this takes forever.
    """
    reenable = False
    if pylab.isinteractive():
        pylab.ioff()
    pylab.clf()
    height, width = W.shape
    if not maxWeight:
        maxWeight = 2**numpy.ceil(numpy.log(numpy.max(numpy.abs(W)))/numpy.log(2))

    pylab.fill(numpy.array([0,width,width,0]),numpy.array([0,0,height,height]),'gray')
    pylab.axis('off')
    pylab.axis('equal')
    for x in xrange(width):
        for y in xrange(height):
            _x = x+1
            _y = y+1
            w = W[y,x]
            if w > 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,w/maxWeight),'white')
            elif w < 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,-w/maxWeight),'black')
    if reenable:
        pylab.ion()
    #pylab.show()
    pylab.savefig(directory)
开发者ID:marcelo-borghetti,项目名称:sampleCode,代码行数:32,代码来源:DataUtil.py


示例10: hinton

def hinton(W, maxWeight=None):
    """
    Source: http://wiki.scipy.org/Cookbook/Matplotlib/HintonDiagrams
    Draws a Hinton diagram for visualizing a weight matrix.
    Temporarily disables matplotlib interactive mode if it is on,
    otherwise this takes forever.
    """
    reenable = False
    if pl.isinteractive():
        pl.ioff()
    pl.clf()
    height, width = W.shape
    if not maxWeight:
        maxWeight = 2**np.ceil(np.log(np.max(np.abs(W)))/np.log(2))

    pl.fill(np.array([0,width,width,0]),np.array([0,0,height,height]),'gray')
    pl.axis('off')
    pl.axis('equal')
    for x in xrange(width):
        for y in xrange(height):
            _x = x+1
            _y = y+1
            w = W[y,x]
            if w > 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,w/maxWeight),'white')
            elif w < 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,-w/maxWeight),'black')
    if reenable:
        pl.ion()
    pl.show()
开发者ID:macabot,项目名称:mlpm_lab,代码行数:30,代码来源:vpca.py


示例11: hinton

def hinton(W,filename="hinton.pdf", maxWeight=None):
    """
    Draws a Hinton diagram for visualizing a weight matrix. 
    Temporarily disables matplotlib interactive mode if it is on, 
    otherwise this takes forever.
    """
    reenable = False
    if P.isinteractive():
        P.ioff()
    P.clf()
    ax=P.subplot(111)
    height, width = W.shape
    if not maxWeight:
        maxWeight = 2**np.ceil(np.log(np.max(np.abs(W)))/np.log(2))

    P.fill(np.array([0,width,width,0]),np.array([0,0,height,height]),'gray')
    P.axis('off')
    #P.axis('equal')
    ax.set_yticklabels(['25','20','15','10','5','0'])
    for x in xrange(width):
        for y in xrange(height):
            _x = x+1
            _y = y+1
            w = W[y,x]
            if w > 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,w/maxWeight),'white')
            elif w < 0:
                _blob(_x - 0.5, height - _y + 0.5, min(1,-w/maxWeight),'black')
    if reenable:
        P.ion()
    P.title(filename)
    P.savefig(filename)
开发者ID:WagnerGroup,项目名称:PK_ExperimentalMainline,代码行数:32,代码来源:dm_tools.py


示例12: __call__

    def __call__(self,output_fn,init_time=0,final_time=None,**params):
        p=ParamOverrides(self,params)

        if final_time is None:
            final_time=topo.sim.time()

        attrs = p.attrib_names if len(p.attrib_names)>0 else output_fn.attrib_names
        for a in attrs:
            pylab.figure(figsize=(6,4))
            isint=pylab.isinteractive()
            pylab.ioff()
            pylab.grid(True)
            ylabel=p.ylabel
            pylab.ylabel(a+" "+ylabel)
            pylab.xlabel('Iteration Number')

            coords = p.units if len(p.units)>0 else output_fn.units
            for coord in coords:
                y_data=[y for (x,y) in output_fn.values[a][coord]]
                x_data=[x for (x,y) in output_fn.values[a][coord]]
                if p.raw==True:
                    plot_data=zip(x_data,y_data)
                    pylab.save(normalize_path(p.filename+a+'(%.2f, %.2f)' %(coord[0], coord[1])),plot_data,fmt='%.6f', delimiter=',')


                pylab.plot(x_data,y_data, label='Unit (%.2f, %.2f)' %(coord[0], coord[1]))
                (ymin,ymax)=p.ybounds
                pylab.axis(xmin=init_time,xmax=final_time,ymin=ymin,ymax=ymax)

            if isint: pylab.ion()
            pylab.legend(loc=0)
            p.title=topo.sim.name+': '+a
            p.filename_suffix=a
            self._generate_figure(p)
开发者ID:KeithRobertson,项目名称:topographica,代码行数:34,代码来源:pylabplot.py


示例13: read_text_pyfusion

def read_text_pyfusion(files, target='^Shot .*', ph_dtype=None, plot=pl.isinteractive(), ms=100, hold=0, debug=0, quiet=1,  exception = Exception):
    """ Accepts a file or a list of files, returns a list of structured arrays
    See merge ds_list to merge and convert types (float -> pyfusion.prec_med
    """
    st = seconds(); last_update=seconds()
    file_list = files
    if len(np.shape(files)) == 0: file_list = [file_list]
    f='f8'
    if ph_dtype == None: ph_dtype = [('p12',f),('p23',f),('p34',f),('p45',f),('p56',f)]
    #ph_dtype = [('p12',f)]
    ds_list =[]
    comment_list =[]
    count = 0
    for (i,filename) in enumerate(file_list):
        if seconds() - last_update > 30:
            last_update = seconds()
            print('reading {n}/{t}: {f}'
                  .format(f=filename, n=i, t=len(file_list)))
        try:
            if pl.is_string_like(target): 
                skip = 1+find_data(filename, target,debug=debug)
            else: 
                skip = target
            if quiet == 0:
                print('{t:.1f} sec, loading data from line {s} of {f}'
                      .format(t = seconds()-st, s=skip, f=filename))
            #  this little bit to determine layout of data
            # very inefficient to read twice, but in a hurry!
            txt = np.loadtxt(fname=filename, skiprows=skip-1, dtype=str, 
                             delimiter='FOOBARWOOBAR')
            header_toks = txt[0].split()
            # is the first character of the 2nd last a digit?
            if header_toks[-2][0] in '0123456789': 
                if pyfusion.VERBOSE > 0: 
                    print('found new header including number of phases')
                n_phases = int(header_toks[-2])
                ph_dtype = [('p{n}{np1}'.format(n=n,np1=n+1), f) for n in range(n_phases)]
                
            if 'frlow' in header_toks:  # add the two extra fields
                fs_dtype= [ ('shot','i8'), ('t_mid','f8'), 
                            ('_binary_svs','i8'), 
                            ('freq','f8'), ('amp', 'f8'), ('a12','f8'),
                            ('p', 'f8'), ('H','f8'), 
                            ('frlow','f8'), ('frhigh', 'f8'),('phases',ph_dtype)]
            else:
                fs_dtype= [ ('shot','i8'), ('t_mid','f8'), 
                            ('_binary_svs','i8'), 
                            ('freq','f8'), ('amp', 'f8'), ('a12','f8'),
                            ('p', 'f8'), ('H','f8'), ('phases',ph_dtype)]

            ds_list.append(
                np.loadtxt(fname=filename, skiprows = skip, 
                           dtype= fs_dtype)
            )
            count += 1
            comment_list.append(filename)
        except ValueError, info:
            print('Conversion error while reading {f} with loadtxt - {info}'.format(f=filename, info=info))
开发者ID:dpretty,项目名称:pyfusion,代码行数:58,代码来源:read_text_pyfusion.py


示例14: showcol

def showcol(vs, size=(4.1,2), **kwargs):
# {{{
  ''' 
  Plot variable, showing a contour plot for 2d variables or a line plot for 1d variables.

  Parameters
  ----------
  v :  list of lists of :class:`Var`
     The variables to plot. Should have either 1 or 2 non-degenerate axes.

  Notes
  -----
  This function is intended as the simplest way to display the contents of a variable,
  choosing appropriate parameter values as automatically as possible.
  '''

  Z = [v.squeeze() for v in vs]

  assert Z[0].naxes in [1, 2], 'Variables %s has %d non-generate axes; must have 1 or 2.' % (Z.name, Z.naxes)

  for z in Z[1:]:
    assert Z[0].naxes == z.naxes, 'All variables must have the same number of non-generate dimensions'
    #assert all([a == b for a, b in zip(Z[0].axes, z.axes)])

  fig = kwargs.pop('fig', None)

  if Z[0].naxes == 1:
    axs = []
    ydat = []
    for v in vs:
      lblx = (v is vs[-1])
      ax = vplot(v, lblx = lblx, **kwargs)
      ax.size = size
      axs.append([ax])
      ydat.append(ax.find_plot(wr.Plot).plot_args[1])

    Ax = wr.grid(axs)
    ylim = (np.min([np.min(y) for y in ydat]), np.max([np.max(y) for y in ydat]))
    Ax.setp(ylim = ylim, children=True)

  elif Z[0].naxes == 2:
    axs = []
    for v in vs:
      lblx = (v is vs[-1])
      ax = vcontour(v, lblx = lblx, **kwargs)
      ax.size = size
      axs.append([ax])

    Ax = wr.grid(axs)

    cbar = kwargs.pop('colorbar', dict(orientation='vertical'))
    cf = Ax.axes[0].find_plot(wr.Contourf)
    if cbar and cf is not None:
      Ax = wr.colorbar(Ax, cf, **cbar)

  import pylab as pyl
  if pyl.isinteractive(): Ax.render(fig)
  return Ax
开发者ID:aerler,项目名称:pygeode,代码行数:58,代码来源:pyg_helpers.py


示例15: showslice

def showslice(theslice):
    if P.isinteractive():
	P.ioff()
    P.axis('off')
    P.axis('equal')
    P.axis('tight')
    P.imshow(theslice, interpolation='nearest', aspect='equal', cmap=P.cm.gray)
    P.colorbar()
    return()
开发者ID:bbfrederick,项目名称:stabilitycalc,代码行数:9,代码来源:stabilityfuncs.py


示例16: plot_polar

def plot_polar(
    theta, r, x_label=None, y_label=None, title=None, show_legend=True, axis_equal=False, ax=None, *args, **kwargs
):
    """
    plots polar data on a polar plot and optionally label axes.

    Parameters
    ------------
    theta : array-like
        data to plot
    r : array-like
        
    x_label : string
        x-axis label
    y_label : string
        y-axis label
    title : string
        plot title
    show_legend : Boolean
        controls the drawing of the legend
    ax : :class:`matplotlib.axes.AxesSubplot` object
        axes to draw on
    *args,**kwargs : passed to pylab.plot
    
    See Also
    ----------
    plot_rectangular : plots rectangular data
    plot_complex_rectangular : plot complex data on complex plane
    plot_polar : plot polar data
    plot_complex_polar : plot complex data on polar plane
    plot_smith : plot complex data on smith chart

    """
    if ax is None:
        ax = plb.gca(polar=True)

    ax.plot(theta, r, *args, **kwargs)

    if x_label is not None:
        ax.set_xlabel(x_label)

    if y_label is not None:
        ax.set_ylabel(y_label)

    if title is not None:
        ax.set_title(title)

    if show_legend:
        # only show legend if they provide a label
        if "label" in kwargs:
            ax.legend()

    if axis_equal:
        ax.axis("equal")

    if plb.isinteractive():
        plb.draw()
开发者ID:mattguidry,项目名称:scikit-rf,代码行数:57,代码来源:plotting.py


示例17: plot_smith

def plot_smith(z, smith_r=1, chart_type='z', x_label='Real',
    y_label='Imaginary', title='Complex Plane', show_legend=True,
    axis='equal', ax=None, force_chart = False, *args, **kwargs):
    '''
    plot complex data on smith chart

    Parameters
    ------------
    z : array-like, of complex data
        data to plot
    smith_r : number
        radius of smith chart
    chart_type : ['z','y']
        Contour type for chart.
         * *'z'* : lines of constant impedance
         * *'y'* : lines of constant admittance
    x_label : string
        x-axis label
    y_label : string
        y-axis label
    title : string
        plot title
    show_legend : Boolean
        controls the drawing of the legend
    axis_equal: Boolean
        sets axis to be equal increments (calls axis('equal'))
    force_chart : Boolean
        forces the re-drawing of smith chart 
    ax : :class:`matplotlib.axes.AxesSubplot` object
        axes to draw on
    *args,**kwargs : passed to pylab.plot

    See Also
    ----------
    plot_rectangular : plots rectangular data
    plot_complex_rectangular : plot complex data on complex plane
    plot_polar : plot polar data
    plot_complex_polar : plot complex data on polar plane
    plot_smith : plot complex data on smith chart
    '''
    
    if ax is None:
        ax = plb.gca()

    # test if smith chart is already drawn
    if not force_chart:
        if len(ax.patches) == 0:
            smith(ax=ax, smithR = smith_r, chart_type=chart_type)

    plot_complex_rectangular(z, x_label=x_label, y_label=y_label,
        title=title, show_legend=show_legend, axis=axis,
        ax=ax, *args, **kwargs)

    ax.axis(smith_r*npy.array([-1.1, 1.1, -1.1, 1.1]))
    if plb.isinteractive():
        plb.draw()
开发者ID:edy555,项目名称:scikit-rf,代码行数:56,代码来源:plotting.py


示例18: plot

 def plot(self):
     """
     Draw this layout to a matplotlib canvas.
     """
     fig = self._doPlot()
     if not pylab.isinteractive():
         pylab.show()
     else:
         pylab.draw()
     pylab.close(fig)
开发者ID:crazyideas21,项目名称:swclone,代码行数:10,代码来源:PlotLayout.py


示例19: draw_selection

    def draw_selection(self, lbl, replace=True):
        """ draw a given subset """
        if (lbl not in self._draws) | (replace is True):
            sample = self.selections[lbl]

            self._draws[lbl] = sample.draw(self.x, self.y, ax=self.axes)

            if plt.isinteractive():
                self.draw()

            return sample, self._draws[lbl]
开发者ID:mfouesneau,项目名称:ezviz,代码行数:11,代码来源:ezviz.py


示例20: wrapper

 def wrapper(*args, **kwds):
     interactive_mode = P.isinteractive()
     if interactive_mode:
         #logging.debug('Turning pylab interactive off.')
         P.ioff()
     try:
         return fn(*args, **kwds)
     finally:
         if interactive_mode:
             #logging.debug('Turning pylab interactive on.')
             P.ion()
开发者ID:JohnReid,项目名称:Cookbook,代码行数:11,代码来源:pylab_utils.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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