示例#1
0
     def setx(x):
         if x is None:
             return
 
         import numpy as np
         try:
             arr = np.array(x)
         except Exception as e:
             errmsg = 'Matplotlib widgets need an array-like value'
             raise TypeError(errmsg) from e
 
         with Ax(self) as ax:
             if len(arr.shape) == 1:
                 ax.plot(arr)
             elif len(arr.shape) == 2:
                 ax.imshow(arr)
             else:
                 raise ValueError('Value must be 1d or 2d, shape is %s instead'
                                  % str(arr.shape))
示例#2
0
def replot(gui, value):

    with Ax(gui.plot) as ax:
        ax.set_title('y=sin(x)')
        t = np.linspace(0, 1+value/10, 500)
        ax.plot(t, np.sin(t), ".-")
示例#3
0
文件: GUI.py 项目: ChiaraSelmi/M4
def setPlot4(gui, oi, smap1, cmap='hot'):
    with Ax(gui.plot4) as ax:
        ax.clear()
        ax.set_title('Titolo')
        im = ax.imshow(smap1, origin='lower', cmap=cmap)
示例#4
0
文件: GUI.py 项目: ChiaraSelmi/M4
def setPlot3(gui, oi, cmap='viridis'):
    with Ax(gui.plot3) as ax:
        ax.clear()
        ax.set_title('Titolo')
        im = ax.imshow(oi.ott_view(), origin='lower', cmap=cmap)
示例#5
0
文件: GUI.py 项目: ChiaraSelmi/M4
def setPlot2(gui, oi, smap1, smask, cmap='viridis'):
    image = oi.pwrap(smap1, smask)
    with Ax(gui.plot2) as ax:
        ax.clear()
        ax.set_title('Titolo')
        im = ax.imshow(image, origin='lower', cmap=cmap)
示例#6
0
文件: GUI.py 项目: ChiaraSelmi/M4
def setPlot(gui, image, cmap='viridis'):
    with Ax(gui.plot) as ax:
        ax.clear()
        ax.set_title('Titolo')
        im = ax.imshow(image, origin='lower', cmap=cmap)