• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python axes3d.get_test_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: grafica

def grafica():
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    ax.plot_surface(X, Y, Z, rstride=3, 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()
开发者ID:rlopezn,项目名称:ComputacionParalela2S-2014,代码行数:17,代码来源:Tarea4-Serial.py


示例17: show3D

def show3D():
    '''Generation of 3D plots'''
    
    # imports specific to the plots in this example
    from matplotlib import cm   # colormaps
    
    # This module is required for 3D plots!
    from mpl_toolkits.mplot3d import Axes3D
    
    # Twice as wide as it is tall.
    fig = plt.figure(figsize=plt.figaspect(0.5))
    setFonts(16)
    
    #---- First subplot
    # Generate the data
    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)
    
    # Note the definition of "projection", required for 3D  plots
    #plt.style.use('ggplot')

    ax = fig.add_subplot(1, 2, 1, projection='3d')
    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.GnBu,
            linewidth=0, antialiased=False)
    #surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis_r,
            #linewidth=0, antialiased=False)
    ax.set_zlim3d(-1.01, 1.01)
    
    fig.colorbar(surf, shrink=0.5, aspect=10)
    
    #---- Second subplot
    # Get some 3d test-data
    from mpl_toolkits.mplot3d.axes3d import get_test_data
    
    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)

    showData('3dGraph.png')
开发者ID:NanoResearch,项目名称:statsintro_python,代码行数:42,代码来源:ISP_showPlots.py


示例18: generate_test_data

def generate_test_data():
    """
    Borrowed from http://matplotlib.org/examples/mplot3d/contourf3d_demo2.html
    """
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X, Y, Z = axes3d.get_test_data( 0.1 )
    Z = np.abs( Z )

    ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
    cset = ax.contourf(X, Y, Z, zdir='z', offset=-10, 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(-1, 100)

    plt.show()

    return Z
开发者ID:caja-matematica,项目名称:pyPersistence,代码行数:24,代码来源:test_modules.py


示例19: test_wireframe3d

def test_wireframe3d():
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
开发者ID:Skelpdar,项目名称:matplotlib,代码行数:5,代码来源:test_mplot3d.py


示例20:

# - http://www.astropy.org/astropy-tutorials/FITS-tables.html
# - http://www.astropy.org/astropy-tutorials/FITS-images.html
# - http://www.astropy.org/astropy-tutorials/FITS-header.html

import os.path

from astropy.io import fits
import numpy as np

from mpl_toolkits.mplot3d import axes3d

OUTPUT_PATH = "out.fits"

# CREATE DATA #########################

X1, Y1, Z1 = axes3d.get_test_data(0.05)
X2, Y2, Z2 = axes3d.get_test_data(0.05)
X3, Y3, Z3 = axes3d.get_test_data(0.05)

Z1 *= 1.
Z2 *= -1.
Z3 *= 2.

img = np.stack([Z1, Z2, Z3], 0)

print("Image shape:", img.shape)

# CREATE THE FITS STRUCTURE ###########

hdu = fits.PrimaryHDU(img)
开发者ID:jeremiedecock,项目名称:snippets,代码行数:30,代码来源:create_a_3d_fits_image.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python proj3d.proj_transform函数代码示例发布时间:2022-05-27
下一篇:
Python art3d.pathpatch_2d_to_3d函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap