Python mpl_toolkits.mplot3d.Axes3D() Examples

The following are 30 code examples of mpl_toolkits.mplot3d.Axes3D(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module mpl_toolkits.mplot3d , or try the search function .
Example #1
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')

        self.canvas.draw() 
Example #2
Source File: emitt_spread.py    From ocelot with GNU General Public License v3.0 6 votes vote down vote up
def plot3D_data(data, x, y):
    X,Y = meshgrid(x,y)
    fig = plt.figure()
    ax = Axes3D(fig)
    #ax = fig.add_subplot(111, projection = "3d")
    ax.plot_surface(X, Y, data, rstride=1, cstride=1, cmap=cm.jet)

#def conditions_emitt_spread(screen):
#    if screen.ne ==1 and (screen.nx and screen.ny):
#        effect = 1
#    elif screen.ne ==1 and (screen.nx==1 and screen.ny):
#        effect = 2
#    elif screen.ne ==1 and (screen.nx and screen.ny == 1):
#        effect = 3
#    elif screen.ne >1 and (screen.nx == 1 and screen.ny == 1):
#        effect = 4
#    else:
#        effect = 0
#    return effect 
Example #3
Source File: draw3dobb.py    From grass_pytorch with Apache License 2.0 6 votes vote down vote up
def tryPlot():
    cmap = plt.get_cmap(u'jet_r')
    fig = plt.figure()
    ax = Axes3D(fig)
    draw(ax, [-0.0152730000000000,-0.113074400000000,0.00867852000000000,0.766616000000000,0.483920000000000,0.0964542000000000,
               8.65505000000000e-06,-0.000113369000000000,0.999997000000000,0.989706000000000,0.143116000000000,7.65900000000000e-06], cmap(float(1)/7))
    draw(ax, [-0.310188000000000,0.188456800000000,0.00978854000000000,0.596362000000000,0.577190000000000,0.141414800000000,
               -0.331254000000000,0.943525000000000,0.00456327000000000,-0.00484978000000000,-0.00653891000000000,0.999967000000000], cmap(float(2)/7))
    draw(ax, [-0.290236000000000,-0.334664000000000,-0.328648000000000,0.322898000000000,0.0585966000000000,0.0347996000000000,
               -0.330345000000000,-0.942455000000000,0.0514932000000000,0.0432524000000000,0.0393726000000000,0.998095000000000], cmap(float(3)/7))
    draw(ax, [-0.289462000000000,-0.334842000000000,0.361558000000000,0.322992000000000,0.0593536000000000,0.0350418000000000,
               0.309240000000000,0.949730000000000,0.0485183000000000,-0.0511885000000000,-0.0343219000000000,0.998099000000000], cmap(float(4)/7))
    draw(ax, [0.281430000000000,-0.306584000000000,0.382928000000000,0.392156000000000,0.0409424000000000,0.0348472000000000,
               0.322342000000000,-0.942987000000000,0.0828920000000000,-0.0248683000000000,0.0791002000000000,0.996556000000000], cmap(float(5)/7))
    draw(ax, [0.281024000000000,-0.306678000000000,-0.366110000000000,0.392456000000000,0.0409366000000000,0.0348446000000000,
               -0.322608000000000,0.942964000000000,0.0821142000000000,0.0256742000000000,-0.0780031000000000,0.996622000000000], cmap(float(6)/7))
    draw(ax, [0.121108800000000,-0.0146729400000000,0.00279166000000000,0.681576000000000,0.601756000000000,0.0959706000000000,
               -0.986967000000000,-0.160173000000000,0.0155341000000000,0.0146809000000000,0.00650174000000000,0.999801000000000], cmap(float(7)/7))
    plt.show() 
Example #4
Source File: plot.py    From evo with GNU General Public License v3.0 6 votes vote down vote up
def tabbed_qt4_window(self):
        from PyQt4 import QtGui
        from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT
        # mpl backend can already create instance
        # https://stackoverflow.com/a/40031190
        app = QtGui.QApplication.instance()
        if app is None:
            app = QtGui.QApplication([self.title])
        self.root_window = QtGui.QTabWidget()
        self.root_window.setWindowTitle(self.title)
        for name, fig in self.figures.items():
            tab = QtGui.QWidget(self.root_window)
            tab.canvas = FigureCanvasQTAgg(fig)
            vbox = QtGui.QVBoxLayout(tab)
            vbox.addWidget(tab.canvas)
            toolbar = NavigationToolbar2QT(tab.canvas, tab)
            vbox.addWidget(toolbar)
            tab.setLayout(vbox)
            for axes in fig.get_axes():
                if isinstance(axes, Axes3D):
                    # must explicitly allow mouse dragging for 3D plots
                    axes.mouse_init()
            self.root_window.addTab(tab, name)
        self.root_window.show()
        app.exec_() 
Example #5
Source File: plot.py    From evo with GNU General Public License v3.0 6 votes vote down vote up
def tabbed_qt5_window(self):
        from PyQt5 import QtGui, QtWidgets
        from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT
        # mpl backend can already create instance
        # https://stackoverflow.com/a/40031190
        app = QtGui.QGuiApplication.instance()
        if app is None:
            app = QtWidgets.QApplication([self.title])
        self.root_window = QtWidgets.QTabWidget()
        self.root_window.setWindowTitle(self.title)
        for name, fig in self.figures.items():
            tab = QtWidgets.QWidget(self.root_window)
            tab.canvas = FigureCanvasQTAgg(fig)
            vbox = QtWidgets.QVBoxLayout(tab)
            vbox.addWidget(tab.canvas)
            toolbar = NavigationToolbar2QT(tab.canvas, tab)
            vbox.addWidget(toolbar)
            tab.setLayout(vbox)
            for axes in fig.get_axes():
                if isinstance(axes, Axes3D):
                    # must explicitly allow mouse dragging for 3D plots
                    axes.mouse_init()
            self.root_window.addTab(tab, name)
        self.root_window.show()
        app.exec_() 
Example #6
Source File: benchmark.py    From NiaPy with MIT License 6 votes vote down vote up
def plot3d(self, scale=0.32):
		r"""Plot 3d scatter plot of benchmark function.

		Args:
			scale (float): Scale factor for points.
		"""
		fig = plt.figure()
		ax = Axes3D(fig)
		func = self.function()
		Xr, Yr = arange(self.Lower, self.Upper, scale), arange(self.Lower, self.Upper, scale)
		X, Y = meshgrid(Xr, Yr)
		Z = vectorize(self.__2dfun)(X, Y, func)
		ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
		ax.contourf(X, Y, Z, zdir='z', offset=-10, cmap=cm.coolwarm)
		ax.set_xlabel('X')
		ax.set_ylabel('Y')
		ax.set_zlabel('Z')
		plt.show()

# vim: tabstop=3 noexpandtab shiftwidth=3 softtabstop=3 
Example #7
Source File: draw3dobb.py    From grass_pytorch with Apache License 2.0 6 votes vote down vote up
def showGenshapes(genshapes):
    for i in xrange(len(genshapes)):
        recover_boxes = genshapes[i]

        fig = plt.figure(i)
        cmap = plt.get_cmap(u'jet_r')
        ax = Axes3D(fig)
        ax.set_xlim(-0.7, 0.7)
        ax.set_ylim(-0.7, 0.7)
        ax.set_zlim(-0.7, 0.7)

        for jj in xrange(len(recover_boxes)):
            p = recover_boxes[jj][:]
            draw(ax, p, cmap(float(jj)/len(recover_boxes)))

        plt.show() 
Example #8
Source File: eval_plots.py    From AugmentedAutoencoder with MIT License 6 votes vote down vote up
def compute_pca_plot_embedding(eval_dir, z_train, z_test=None, save=True):
    sklearn_pca = PCA(n_components=3)
    full_z_pca = sklearn_pca.fit_transform(z_train)
    if z_test is not None:
        full_z_pca_test = sklearn_pca.transform(z_test)

    fig = plt.figure()
    ax = Axes3D(fig)

    c=np.linspace(0, 1, len(full_z_pca))
    ax.scatter(full_z_pca[:,0],full_z_pca[:,1],full_z_pca[:,2], c=c, marker='.', label='PCs of train viewsphere')
    if z_test is not None:
        ax.scatter(full_z_pca_test[:,0],full_z_pca_test[:,1],full_z_pca_test[:,2], c='red', marker='.', label='test_z')

    plt.title('Embedding Principal Components')
    ax.set_xlabel('pc1')
    ax.set_ylabel('pc2')
    ax.set_zlabel('pc3')

    plt.legend()
    pl.dump(fig,file(os.path.join(eval_dir,'figures','pca_embedding.pickle'),'wb'))
    if save:
        plt.savefig(os.path.join(eval_dir,'figures','pca_embedding.pdf')) 
Example #9
Source File: streaming.py    From jMetalPy with MIT License 6 votes vote down vote up
def create_layout(self, dimension: int) -> None:
        self.fig.canvas.set_window_title(self.plot_title)
        self.fig.suptitle(self.plot_title, fontsize=16)

        if dimension == 2:
            # Stylize axis
            self.ax.spines['top'].set_visible(False)
            self.ax.spines['right'].set_visible(False)
            self.ax.get_xaxis().tick_bottom()
            self.ax.get_yaxis().tick_left()
        elif dimension == 3:
            self.ax = Axes3D(self.fig)
            self.ax.autoscale(enable=True, axis='both')
        else:
            raise Exception('Dimension must be either 2 or 3')

        self.ax.set_autoscale_on(True)
        self.ax.autoscale_view(True, True, True)

        # Style options
        self.ax.grid(color='#f0f0f5', linestyle='-', linewidth=0.5, alpha=0.5) 
Example #10
Source File: datasets.py    From TextDetector with GNU General Public License v3.0 6 votes vote down vote up
def do_3d_scatter(x, y, z, figno=None, title=None):
    """
    Generate a 3D scatterplot figure and optionally give it a title.

    Parameters
    ----------
    x : WRITEME
    y : WRITEME
    z : WRITEME
    figno : WRITEME
    title : WRITEME
    """
    fig = pyplot.figure(figno)
    ax = Axes3D(fig)
    ax.scatter(x, y, z)
    ax.set_xlabel("X")
    ax.set_ylabel("Y")
    ax.set_zlabel("Z")
    pyplot.suptitle(title) 
Example #11
Source File: mpl.py    From pwtools with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def fig_ax3d(clean=False, **kwds):
    """``fig,ax3d = fig_ax()``

    Parameters
    ----------
    clean : bool
        see :func:`clean_ax3d`
    """
    fig = plt.figure(**kwds)
    try:
        ax = fig.add_subplot(111, projection='3d')
    except:
        # mpl < 1.0.0
        ax = Axes3D(fig)
    if clean:
        clean_ax3d(ax)
    return fig, ax 
Example #12
Source File: skutils.py    From grammar-activity-prediction with MIT License 6 votes vote down vote up
def plot_skeleton_with_points(skeleton_sequence, pts_sequences, frames):
    def plot_frame(f):
        plot_skeleton(skeleton_sequence[f, :], ax)
        for pts_sequence in pts_sequences:
            plot_point_cloud(pts_sequence[f], ax)

    if frames < 0:
        frame_range = range(skeleton_sequence.shape[0])
    else:
        frame_range = range(frames)
    fig = plt.figure()
    ax = Axes3D(fig)
    ax.view_init(elev=0., azim=270)
    ax.set_xlim(-2, 2)
    ax.set_ylim(-2, 2)
    plt.axis('equal')

    for f in frame_range:
        plot_frame(f)
        fig.canvas.draw_idle()
        plt.pause(0.05)
        ax.cla()
    ani = animation.FuncAnimation(fig, plot_frame, frame_range, interval=25, blit=True)

    plt.show() 
Example #13
Source File: vis_tools.py    From USIP with GNU General Public License v3.0 6 votes vote down vote up
def plot_pc_old(pc_np, z_cutoff=70, birds_view=False, color='height', size=0.3, ax=None):
    # remove large z points
    valid_index = pc_np[:, 2] < z_cutoff
    pc_np = pc_np[valid_index, :]

    if ax is None:
        fig = plt.figure(figsize=(9, 9))
        ax = Axes3D(fig)
    if color == 'height':
        c = pc_np[:, 1]
        ax.scatter(pc_np[:, 0].tolist(), pc_np[:, 1].tolist(), pc_np[:, 2].tolist(), s=size, c=c, cmap=cm.jet_r)
    elif color == 'reflectance':
        assert False
    else:
        ax.scatter(pc_np[:, 0].tolist(), pc_np[:, 1].tolist(), pc_np[:, 2].tolist(), s=size, c=color)

    axisEqual3D(ax)
    if True == birds_view:
        ax.view_init(elev=0, azim=-90)
    else:
        ax.view_init(elev=-45, azim=-90)
    # ax.invert_yaxis()

    return ax 
Example #14
Source File: test_utils.py    From grove with Apache License 2.0 6 votes vote down vote up
def test_visualization():
    ax = Axes3D(figure())
    # Without axis.
    ut.state_histogram(grove.tomography.operator_utils.GS, title="test")
    # With axis.
    ut.state_histogram(grove.tomography.operator_utils.GS, ax, "test")
    assert ax.get_title() == "test"

    ptX = grove.tomography.operator_utils.PAULI_BASIS.transfer_matrix(qt.to_super(
        grove.tomography.operator_utils.QX)).toarray()
    ax = Mock()
    with patch("matplotlib.pyplot.colorbar"):
        ut.plot_pauli_transfer_matrix(ptX, ax, grove.tomography.operator_utils.PAULI_BASIS.labels, "bla")
    assert ax.imshow.called
    assert ax.set_xlabel.called
    assert ax.set_ylabel.called 
Example #15
Source File: plot.py    From pychemqt with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self,  dim=2, parent=None):
        self.fig = Figure(figsize=(10, 10), dpi=100)
        self.dim = dim
        FigureCanvasQTAgg.__init__(self, self.fig)
        self.setParent(parent)
        FigureCanvasQTAgg.setSizePolicy(self, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        FigureCanvasQTAgg.updateGeometry(self)

        if dim==2:
            self.ax = self.fig.add_subplot(111)
            self.ax.figure.subplots_adjust(left=0.08, right=0.98, bottom=0.08, top=0.92)

        else:
            self.ax = Axes3D(self.fig)
            self.ax.mouse_init(rotate_btn=1, zoom_btn=2)

        FigureCanvasQTAgg.setSizePolicy(self, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        FigureCanvasQTAgg.updateGeometry(self) 
Example #16
Source File: farfield.py    From spins-b with GNU General Public License v3.0 6 votes vote down vote up
def scatter_plot(ax, points: np.array, triangles: np.array, E2: np.array):
    '''
    plots scatter data 
    Note: The axis has to be made with mpl_toolkits.mplot3d.Axes3D
    '''
    # get the maximum value of E2
    r_max = np.max(E2)
    for i in range(triangles.shape[0]):
        vtx = np.vstack([
            E2[int(triangles[i, 0])] * points[int(triangles[i, 0])],
            E2[int(triangles[i, 1])] * points[int(triangles[i, 1])],
            E2[int(triangles[i, 2])] * points[int(triangles[i, 2])]
        ])
        r = np.sum((np.sum(vtx, axis=0) / 3)**2)**0.5
        tri = a3.art3d.Poly3DCollection([vtx])
        tri.set_color(colors.rgb2hex(get_jet_colors(r / r_max)))
        tri.set_edgecolor('k')
        ax.add_collection3d(tri)
    ax.set_xlim(-r_max, r_max)
    ax.set_ylim(-r_max, r_max)
    ax.set_zlim(-r_max, r_max)


# Analysis functions
##################### 
Example #17
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #18
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #19
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #20
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #21
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #22
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #23
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #24
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #25
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #26
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #27
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #28
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #29
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw() 
Example #30
Source File: MyFigureCanvas.py    From DeepLearning_Wavelet-LSTM with MIT License 6 votes vote down vote up
def MyPlot_surface(self, lineNumber, data, stepX, stepY):
        ''' stepX = 2  # 采样步长 X
            stepY = 10  # 采样步长 Y
        '''
        # ax = self.figure.add_axes([0.05,0.05,0.9,0.9],projection='3d')
        # ax = Axes3D( self.figure )

        X = range(0, len(data), stepX)      #频率
        Y = range(0, len(data[0]), stepY)   #时间

        XX , YY= np.meshgrid(X, Y)  # XX[i]、YY[i]代表时间 ; XX[0][i]、YY[0][i]代表频率
        ZZ = np.zeros([len( Y ), len( X )])  # ZZ[i]代表时间、ZZ[0][i]代表频率

        for i in range(0, len( Y )):
            for j in range(0, len( X )):
                ZZ[i][j] = data[ X[j] ][ Y[i] ]

        # 具体函数方法可用 help(function) 查看,如:help(ax.plot_surface)
        self.axList[lineNumber].plot_surface(XX, YY, ZZ, rstride=1, cstride=1, cmap='rainbow')
        
        # self.canvas.draw()