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


Python axes3d.get_test_data函数代码示例

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


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

示例1: plot3d

def plot3d(gridi):

    from mpl_toolkits.mplot3d import axes3d
    import matplotlib.pyplot as plt
    from matplotlib import cm

    fig = plt.figure()
    ax = fig.gca(projection="3d")
    X, Y, Z = axes3d.get_test_data(0.05)
    print "axes3d.get_test_data(0.05)", list(axes3d.get_test_data(0.05)).shape
    cset = ax.contour(X, Y, Z, extend3d=True, cmap=cm.coolwarm)
    ax.clabel(cset, fontsize=9, inline=1)

    plt.show()
开发者ID:paapu68,项目名称:TiraLabra,代码行数:14,代码来源:piirtoa.py

示例2: contourf_demo

def contourf_demo(**kwargs):
    import mpl_toolkits.mplot3d.axes3d as axes3d
    from ifigure.interactive import contourf, threed, figure
    X, Y, Z = axes3d.get_test_data(0.05) 
    v = figure(gl = True)
    threed('on')
    contourf(X, Y, Z)
开发者ID:piScope,项目名称:piScope,代码行数:7,代码来源:gl_demos.py

示例3: __init__

        def __init__(self, parent, title):
            wx.Frame.__init__(self, parent, title=title, size=(1024, 768))

            Notebook = wx.Notebook(self)

            plot1 = plot(Notebook)
            x_data = [1, 2, 3, 4, 5, 6]
            y_data = npy.random.random(6)
            data = npy.column_stack((x_data, y_data))
            plot1.plot_2d(data, x_column=0, y_column=1, title="test 2d plot")
            Notebook.AddPage(plot1, "2d plot - random data")

            plot2 = plot(Notebook)
            # 3d plot example - grab dummy data from mpl
            from mpl_toolkits.mplot3d import axes3d

            # discard X and Y data - we will provide coverage when we call plot_3d
            X, Y, Z = axes3d.get_test_data(0.5)
            plot2.plot_3d(title="test 3d plot", z_data=Z, x_coverage=5, y_coverage=10)
            Notebook.AddPage(plot2, "3d Plot")

            plot3 = plot(Notebook)
            x1 = npy.arange(-10, 10, 0.5)
            x2 = npy.arange(0, 20, 0.5)
            data = npy.column_stack((x1, x1 ** 2, x2, x2 ** 3))
            plot3.plot_2d_double(data, 0, 1, 2, 3)
            Notebook.AddPage(plot3, "double 2dplot")

            ##        panel.Layout()
            self.Show(True)
开发者ID:jdavidheiser,项目名称:PyDataExplorer,代码行数:30,代码来源:matplot.py

示例4: show3D

def show3D():
    # imports specific to the plots in this example
    import numpy as np
    from matplotlib import cm
    from mpl_toolkits.mplot3d.axes3d import get_test_data
    
    # Twice as wide as it is tall.
    fig = plt.figure(figsize=plt.figaspect(0.5))
    
    #---- First subplot
    ax = fig.add_subplot(1, 2, 1, projection='3d')
    X = np.arange(-5, 5, 0.1)
    Y = np.arange(-5, 5, 0.1)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)
    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
            linewidth=0, antialiased=False)
    ax.set_zlim3d(-1.01, 1.01)
    
    fig.colorbar(surf, shrink=0.5, aspect=10)
    
    #---- Second subplot
    ax = fig.add_subplot(1, 2, 2, projection='3d')
    X, Y, Z = get_test_data(0.05)
    ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

    mystyle.printout_plain('3dGraph.png')
开发者ID:fluxium,项目名称:statsintro,代码行数:28,代码来源:figs_BasicPrinciples.py

示例5: test

def test():
    # Twice as wide as it is tall.
    fig = plt.figure(figsize=plt.figaspect(0.5))

    #---- First subplot
    ax = fig.add_subplot(1, 2, 1, projection='3d')
    X = np.arange(-5, 5, 0.25)
    Y = np.arange(-5, 5, 0.25)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)
    print type(X)
    print X.shape
    print Y.shape
    print Z.shape
    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,
            linewidth=0, antialiased=False)
    ax.set_zlim3d(-1.01, 1.01)

    fig.colorbar(surf, shrink=0.5, aspect=10)

    #---- Second subplot
    ax = fig.add_subplot(1, 2, 2, projection='3d')
    X, Y, Z = get_test_data(0.05)
    ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

    plt.show()
开发者ID:jperezdiaz,项目名称:6.867-final-project,代码行数:27,代码来源:sandbox.py

示例6: plot_charge_den

def plot_charge_den():
    """Test function; Was not used"""
    from mpl_toolkits.mplot3d import axes3d
    import matplotlib.pyplot as plt
    from matplotlib import cm

    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    # print X
    # print Y
    # print Z

    ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
    # cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
    # cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
    # cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)

    ax.set_xlabel('X')
    ax.set_xlim(-40, 40)
    ax.set_ylabel('Y')
    ax.set_ylim(-40, 40)
    ax.set_zlabel('Z')
    ax.set_zlim(-100, 100)

    plt.show()

    return
开发者ID:dimonaks,项目名称:siman,代码行数:28,代码来源:functions.py

示例7: test_mixedsamplesraises

def test_mixedsamplesraises():
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    with pytest.raises(ValueError):
        ax.plot_wireframe(X, Y, Z, rstride=10, ccount=50)
    with pytest.raises(ValueError):
        ax.plot_surface(X, Y, Z, cstride=50, rcount=10)
开发者ID:magnunor,项目名称:matplotlib,代码行数:8,代码来源:test_mplot3d.py

示例8: noisy_test_data

def noisy_test_data(num):
    X, Y, Z = axes3d.get_test_data(0.05)

    x = np.random.randint(0, Z.shape[0], num)
    y = np.random.randint(0, Z.shape[1], num)
    for i, j in zip(x, y):
        Z[i, j] = np.random.random_sample() * 8
    return Z
开发者ID:aqiu1216,项目名称:phase-unwrapping-notes,代码行数:8,代码来源:util.py

示例9: contour_demo2

def contour_demo2(**kwargs):
    import mpl_toolkits.mplot3d.axes3d as axes3d
    from ifigure.interactive import contourf, threed, figure, hold
    X, Y, Z = axes3d.get_test_data(0.05) 
    v = figure(gl = True)
    threed('on')
    hold('on')
    contourf(X, Y, Z)    
    contourf(X, Y, Z, zdir = 'x', offset = -40)
开发者ID:piScope,项目名称:piScope,代码行数:9,代码来源:gl_demos.py

示例10: test_contour3d

def test_contour3d():
    fig = plt.figure()
    ax = fig.gca(projection="3d")
    X, Y, Z = axes3d.get_test_data(0.05)
    cset = ax.contour(X, Y, Z, zdir="z", offset=-100, cmap=cm.coolwarm)
    cset = ax.contour(X, Y, Z, zdir="x", offset=-40, cmap=cm.coolwarm)
    cset = ax.contour(X, Y, Z, zdir="y", offset=40, cmap=cm.coolwarm)
    ax.set_xlim(-40, 40)
    ax.set_ylim(-40, 40)
    ax.set_zlim(-100, 100)
开发者ID:JamesPinkard,项目名称:matplotlib,代码行数:10,代码来源:test_mplot3d.py

示例11: draw_wireframe

def draw_wireframe():
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    x, y, z = axes3d.get_test_data(0.05)
    # def z_func(x,y):
    #     return x+y
    z = x**2+y**4
    ax.plot_wireframe(x, y, z, rstride=10, cstride=10)

    plt.show()
开发者ID:RobLeggett,项目名称:codes,代码行数:10,代码来源:3d_tutorial.py

示例12: test_contourf3d

def test_contourf3d():
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
    cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
    cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
    ax.set_xlim(-40, 40)
    ax.set_ylim(-40, 40)
    ax.set_zlim(-100, 100)
开发者ID:Skelpdar,项目名称:matplotlib,代码行数:10,代码来源:test_mplot3d.py

示例13: solve2

def solve2():
    plt.ion()
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    X, Y, Z = axes3d.get_test_data(0.1)
    print X.shape
    print Z.shape
    ax.scatter(X, Y, Z)

    plt.show()
开发者ID:tjdetwiler,项目名称:project_euler,代码行数:10,代码来源:p262.py

示例14: plot

def plot():
    #numpy.set_printoptions(threshold='nan')
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    print X
    ax.set_xlabel('TIME (DAYS)')
    ax.set_ylabel('Optimal Minimized Risk')
    ax.set_zlabel('Price (USD$)')

    ax.plot_surface(X, Y, Z,cmap=plt.cm.jet, rstride=10, cstride=10)
    plt.show()
开发者ID:jgilyard,项目名称:Portfolio,代码行数:12,代码来源:new_3D.py

示例15: wire

def wire():
    from mpl_toolkits.mplot3d import axes3d
    import matplotlib.pyplot as plt
    import numpy as np

    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    x, y, z = axes3d.get_test_data(0.05)
    x = np.linspace(1,10,100)
    y = np.linspace(4,10,100)
    z = np.linspace(8,10,100)
    ax.plot_wireframe(x, y, z, rstride=10, cstride=10)

    plt.show()
开发者ID:brenden17,项目名称:infinity,代码行数:14,代码来源:mpl.py


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