当前位置: 首页>>代码示例>>Python>>正文


Python Plot.show方法代码示例

本文整理汇总了Python中plot.Plot.show方法的典型用法代码示例。如果您正苦于以下问题:Python Plot.show方法的具体用法?Python Plot.show怎么用?Python Plot.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plot.Plot的用法示例。


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

示例1: main

# 需要导入模块: from plot import Plot [as 别名]
# 或者: from plot.Plot import show [as 别名]
def main():
  imgSrc=os.listdir(c.test)
  imagenes=[]
  tmp=[]
  for e in imgSrc:
    img=Imagen(e).imagen
    rects=f.detectCara(img)
    im,key=opc.dibujarPuntos(img)
    tmp.append((im,e))
  plt=Plot()
  plt.show(tmp,5)
开发者ID:mandrewcito,项目名称:GEI-VA,代码行数:13,代码来源:puntosCaracteristicos.py

示例2: main

# 需要导入模块: from plot import Plot [as 别名]
# 或者: from plot.Plot import show [as 别名]
def main():
  imgSrc=os.listdir(c.test)
  imagenes=[]
  total=0
  detectadas=0
  for e in imgSrc:
    total+=1
    im,todo=f.detectFace(Imagen(e).imagen,e)
    if todo:
      detectadas+=1
    tmp=Imagen(im,name=e)
    imagenes.append(tmp)
  plt=Plot()
  tmp=[]
  print "total caras = "+str(total)+" todo detectado = "+str(detectadas)
  for e in imagenes:
    tmp.append((e.imagen,e.name))
  plt.show(tmp,5)
开发者ID:mandrewcito,项目名称:GEI-VA,代码行数:20,代码来源:deteccionCaras.py

示例3: plot_implicit

# 需要导入模块: from plot import Plot [as 别名]
# 或者: from plot.Plot import show [as 别名]

#.........这里部分代码省略.........

    Using mesh grid and not using adaptive meshing.

    >>> p4 = plot_implicit(Eq(x**2 + y**2, 5),
    ...         (x, -5, 5), (y, -2, 2), adaptive=False)

    Using mesh grid with number of points as input.

    >>> p5 = plot_implicit(Eq(x**2 + y**2, 5),
    ...         (x, -5, 5), (y, -2, 2),
    ...         adaptive=False, points=400)

    Plotting regions.

    >>> p6 = plot_implicit(y > x**2)

    Plotting Using boolean conjunctions.

    >>> p7 = plot_implicit(And(y > x, y > -x))
    """
    has_equality = False  # Represents whether the expression contains an Equality,
                     #GreaterThan or LessThan

    def arg_expand(bool_expr):
        """
        Recursively expands the arguments of an Boolean Function
        """
        for arg in bool_expr.args:
            if isinstance(arg, BooleanFunction):
                arg_expand(arg)
            elif isinstance(arg, Relational):
                arg_list.append(arg)

    arg_list = []
    if isinstance(expr, BooleanFunction):
        arg_expand(expr)

    #Check whether there is an equality in the expression provided.
        if any(isinstance(e, (Equality, GreaterThan, LessThan))
               for e in arg_list):
            has_equality = True

    elif not isinstance(expr, Relational):
        expr = Eq(expr, 0)
        has_equality = True
    elif isinstance(expr, (Equality, GreaterThan, LessThan)):
        has_equality = True

    free_symbols = set(expr.free_symbols)
    range_symbols = set([t[0] for t in args])
    symbols = set.union(free_symbols, range_symbols)
    if len(symbols) > 2:
        raise NotImplementedError("Implicit plotting is not implemented for "
                                  "more than 2 variables")

    #Create default ranges if the range is not provided.
    default_range = Tuple(-5, 5)
    if len(args) == 2:
        var_start_end_x = args[0]
        var_start_end_y = args[1]
    elif len(args) == 1:
        if len(free_symbols) == 2:
            var_start_end_x = args[0]
            var_start_end_y, = (Tuple(e) + default_range
                                for e in (free_symbols - range_symbols))
        else:
            var_start_end_x, = (Tuple(e) + default_range for e in free_symbols)
            #Create a random symbol
            var_start_end_y = Tuple(Dummy()) + default_range

    elif len(args) == 0:
        if len(free_symbols) == 1:
            var_start_end_x, = (Tuple(e) + default_range for e in free_symbols)
            #create a random symbol
            var_start_end_y = Tuple(Dummy()) + default_range
        else:
            var_start_end_x, var_start_end_y = (Tuple(e) + default_range
                                                for e in free_symbols)

    use_interval = kwargs.pop('adaptive', True)
    nb_of_points = kwargs.pop('points', 300)
    depth = kwargs.pop('depth', 0)
    #Check whether the depth is greater than 4 or less than 0.
    if depth > 4:
        depth = 4
    elif depth < 0:
        depth = 0

    series_argument = ImplicitSeries(expr, var_start_end_x, var_start_end_y,
                                    has_equality, use_interval, depth,
                                    nb_of_points)
    show = kwargs.pop('show', True)

    #set the x and y limits
    kwargs['xlim'] = tuple(float(x) for x in var_start_end_x[1:])
    kwargs['ylim'] = tuple(float(y) for y in var_start_end_y[1:])
    p = Plot(series_argument, **kwargs)
    if show:
        p.show()
    return p
开发者ID:alhirzel,项目名称:sympy,代码行数:104,代码来源:plot_implicit.py

示例4: Datamonitor

# 需要导入模块: from plot import Plot [as 别名]
# 或者: from plot.Plot import show [as 别名]
class Datamonitor(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        # create plots for drawing on
        self.accel_plot = Plot(self, ylabel="Acceleration (g)", numy=3, xrng=10, name="ACCEL")
        self.gyro_plot = Plot(self, ylabel="Angular Velocity (degrees/s)", numy=3, xrng=10, name="GYRO")
        self.mag_plot = Plot(self, ylabel="Field Strength", numy=3, xrng=10, name="MAG")
        self.plots = (self.accel_plot, self.gyro_plot, self.mag_plot)
        self.attitude_plot = Tiltmeter(self)
        self.x = 0
        self.y = 0
        self.width = 0
        self.height = 0
        self.plotnext = 0

    def place(self, x, y, width, height):
        # fit all plots in window
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        figureheight = height/3-4/3*bw
        figurewidth = width-2*bw 
        self.accel_plot.place(x=bw, y=bw, width=figurewidth, height=figureheight)
        self.gyro_plot.place(x=bw, y=figureheight+2*bw, width=figurewidth, height=figureheight)
        self.mag_plot.place(x=bw, y=2*figureheight+3*bw, width=figurewidth-bw-figureheight, height=figureheight)
        self.attitude_plot.place(x=width-figureheight-bw, y=2*figureheight+3*bw, width=figureheight, height=figureheight) 

    def show(self):
        self.accel_plot.show(True)
        self.gyro_plot.show(True)
        self.mag_plot.show(True)
        self.attitude_plot.show(True)
        self.update()

    def hide(self):
        self.accel_plot.show(False)
        self.gyro_plot.show(False)
        self.mag_plot.show(False)
        self.attitude_plot.show(False)

    def update(self):
        self.place(self.x, self.y, self.width, self.height)

    def refresh(self):
        self.plots[self.plotnext].draw()
        self.plotnext = (self.plotnext + 1) % len(self.plots)

    def reset(self):
        for plot in self.plots:
            plot.reset()
        self.attitude_plot.reset()

    def destroy(self):
        self.accel_plot.destroy()
        self.gyro_plot.destroy()
        self.mag_plot.destroy()
开发者ID:QUASR,项目名称:QRET-GUI,代码行数:60,代码来源:datamonitor.py


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