예제 #1
0
파일: pcolor.py 프로젝트: HaMF/guiqwt
def compute_quads2(N=4):
    x = np.linspace(0, N-1, N)
    X, Y = np.meshgrid(x, x)
    Z = X**2+Y**2
    Z = Z.reshape((8, 2))
    item = make.pcolor(Z) # checks if X, Y are properly generated in make.pcolor
    return [item]
예제 #2
0
파일: main.py 프로젝트: MIZiper/rdsp
 def __init__(self, xyz):
     super().__init__(xlabel='Time', ylabel='Frequency',
         xunit='s', yunit='Hz', yreverse=False, lock_aspect_ratio=False)
     (x,y,z) = xyz
     itm = make.pcolor(x,y,z)
     self.plot.add_item(itm)
     self.register_all_image_tools()
예제 #3
0
def compute_quads2(N=4):
    x = np.linspace(0, N-1, N)
    X, Y = np.meshgrid(x, x)
    Z = X**2+Y**2
    Z = Z.reshape((8, 2))
    item = make.pcolor(Z) # checks if X, Y are properly generated in make.pcolor
    return [item]
예제 #4
0
    def pcolorshow(self, aX, aY, aData, title=None):
        """
        Create 2D xyimage for guiqwt image dialog

        Returns
        --------

        plot : ?
          Plot widget in guiqwt ImageDialog
        image : ?
           new image object
        """
        from guiqwt.builder import make
        image = make.pcolor(
            aX,
            aY,
            aData,
            interpolation="nearest",
            title=title,
        )
        plot = self.win.get_plot()
        plot.add_item(image)
        plot.do_autoscale()
        plot.replot()

        return plot, image
예제 #5
0
파일: pcolor.py 프로젝트: gyenney/Tools
def compute_quads3():
    pi = np.pi
    cos = np.cos
    sin = np.sin
    items = []
    for i, t in enumerate(np.linspace(0, 2 * pi, 16)):
        X = np.array([[0.0, cos(t)], [-sin(t), cos(t) - sin(t)]])
        Y = np.array([[0.0, sin(t)], [cos(t), sin(t) + cos(t)]])
        Z = np.array([[1., 2.], [3., 4.]])
        item = make.pcolor(X - 16 + 2 * i, Y - 3, Z)
        items.append(item)
    return items
예제 #6
0
파일: pcolor.py 프로젝트: HaMF/guiqwt
def compute_quads3():
    pi = np.pi
    cos = np.cos
    sin = np.sin
    items = []
    for i, t in enumerate( np.linspace(0, 2*pi, 16) ): 
        X = np.array( [[    0.0, cos(t)],
                       [-sin(t), cos(t)-sin(t)]] )
        Y = np.array( [[   0.0, sin(t)],
                       [cos(t), sin(t)+cos(t)]] )
        Z = np.array([[1., 2.], [3., 4.]])
        item = make.pcolor(X-16+2*i, Y-3, Z)
        items.append(item)
    return items
예제 #7
0
def pcolor(*args):
    """
    Create a pseudocolor plot of a 2-D array
    
    Example:
    
    import numpy as np
    r = np.linspace(1., 16, 100)
    th = np.linspace(0., np.pi, 100)
    R, TH = np.meshgrid(r, th)
    X = R*np.cos(TH)
    Y = R*np.sin(TH)
    Z = 4*TH+R
    pcolor(X, Y, Z)
    show()
    """
    axe = gca()
    img = make.pcolor(*args)
    axe.add_image(img)
    axe.yreverse = len(args) == 1
    _show_if_interactive()
    return [img]
예제 #8
0
파일: pyplot.py 프로젝트: stonebig/guiqwt-1
def pcolor(*args):
    """
    Create a pseudocolor plot of a 2-D array
    
    Example:
    
    import numpy as np
    r = np.linspace(1., 16, 100)
    th = np.linspace(0., np.pi, 100)
    R, TH = np.meshgrid(r, th)
    X = R*np.cos(TH)
    Y = R*np.sin(TH)
    Z = 4*TH+R
    pcolor(X, Y, Z)
    show()
    """
    axe = gca()
    img = make.pcolor(*args)
    axe.add_image(img)
    axe.yreverse = len(args) == 1
    _show_if_interactive()
    return [img]
예제 #9
0
파일: pcolor.py 프로젝트: gyenney/Tools
def compute_quads(N=300):
    X, Y, Z = polar_demo(N)
    item = make.pcolor(X, Y, Z)
    return [item]
예제 #10
0
파일: pcolor.py 프로젝트: HaMF/guiqwt
def compute_quads(N=300):
    X, Y, Z = polar_demo(N)
    item = make.pcolor(X, Y, Z)
    return [item]