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


Python graph_objs.Surface方法代码示例

本文整理汇总了Python中plotly.graph_objs.Surface方法的典型用法代码示例。如果您正苦于以下问题:Python graph_objs.Surface方法的具体用法?Python graph_objs.Surface怎么用?Python graph_objs.Surface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plotly.graph_objs的用法示例。


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

示例1: genSphere

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Surface [as 别名]
def genSphere(vizMTX):
    """ Returns trace of sphere with intensity as surface color

    Parameters
    ----------
    vizMTX : array_like
        Matrix holding spherical data for visualization

    Returns
    -------
    T : plotly_trace
        Trace of desired sphere
    """
    coords = genSphCoords()

    trace = go.Surface(
        x=coords.x,
        y=coords.y,
        z=coords.z,
        surfacecolor=_np.abs(vizMTX.reshape((181, -1))).T,
        colorscale='Viridis',
        showscale=False,
        hoverinfo='none'
    )
    return trace 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:27,代码来源:plot.py

示例2: __init__

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Surface [as 别名]
def __init__(self, R, Rp, Rpp, Z, Zp, D, vis_mode='3D') :
		"""
		Creates a Surface (d=2) of Revolution from function handles.
		
		Arguments :
		R 	-- @(r,t) -> R(r,t), the distance to z-axis
		Rp	-- its first derivative
		Rpp	-- its second derivative
		Z 	-- elevation function
		Zp 	-- derivative of the elevation function
		D 	-- periodic domain bounds, [[min_r, max_r], [min_t, max_t]]
		"""
		g = lambda q : array([[1, 0], [0, R(q[0])**2]])
		RManifold.__init__(self, 2, g)
		self.D = D
		self.R = R 
		self.Rp = Rp
		self.Rpp = Rpp
		self.Z = Z
		self.Zp = Zp
		
		self.vis_mode = vis_mode
		self.upsample_trajs = False 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:25,代码来源:surface_of_revolution.py

示例3: genShape

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Surface [as 别名]
def genShape(vizMTX):
    """ Returns trace of shape with intensity as radial extension

    Parameters
    ----------
    vizMTX : array_like
        Matrix holding spherical data for visualization

    Returns
    -------
    T : plotly_trace
        Trace of desired shape

    TODO
    ----
    Fix camera position
    """
    V = sph2cartMTX(vizMTX)

    trace = go.Surface(
        x=V.xs,
        y=V.ys,
        z=V.zs,
        surfacecolor=_np.abs(vizMTX.reshape((181, -1))).T,
        colorscale='Viridis',
        showscale=False,
        hoverinfo='none'
    )
    return trace 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:31,代码来源:plot.py

示例4: genFlat

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Surface [as 别名]
def genFlat(vizMTX):
    """ Returns trace of flat surface with intensity as surface elevation and color

    Parameters
    ----------
    vizMTX : array_like
        Matrix holding spherical data for visualization

    Returns
    -------
    T : plotly_trace
        Trace of desired surface

    TODO
    ----
    Fix orientation and axis limits
    """

    trace = go.Surface(
        x=_np.r_[0:360],
        y=_np.r_[0:181],
        z=_np.abs(vizMTX),
        surfacecolor=_np.abs(vizMTX.reshape((181, -1))),
        colorscale='Viridis',
        showscale=False,
        hoverinfo='none'
    )
    return trace 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:30,代码来源:plot.py

示例5: show_3D

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Surface [as 别名]
def show_3D(self) :
		r  = linspace(self.D[0,0],self.D[0,1], 45)
		th = linspace(self.D[1,0],self.D[1,1], 45)
		
		(R, TH) = meshgrid(r, th)
		b_foo = self.b
		self.b = 0.99*self.b
		(X,Y,Z) = self.I(R = R, Theta = TH)
		self.b = b_foo
		
		surface = go.Surface(x=X, y=Y, z=Z,
                    opacity = 0.99,
                    colorscale = [[0, 'rgb(255,100,0)'], [1, 'rgb(255,255,0)']],
                    autocolorscale = False,
                    showscale = False,
                    hoverinfo = "none",
                    contours = {'x' : {'highlight' : False, 'highlightwidth' : 1},
                                'y' : {'highlight' : False, 'highlightwidth' : 1}, 
                                'z' : {'highlight' : False, 'highlightwidth' : 1}}
                    )
		self.layout['scene']['aspectmode'] = 'cube'
		m = 1.2 * (self.a + self.b)
		self.layout['scene']['xaxis'] = dict( range = [-m, m] )
		self.layout['scene']['yaxis'] = dict( range = [-m, m] )
		self.layout['scene']['zaxis'] = dict( range = [-m, m] )
		self.current_axis.append(surface) 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:28,代码来源:surface_of_revolution.py


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