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


Python graph_objs.Scatter3d方法代码示例

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


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

示例1: plot_traj

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def plot_traj(self, qt, **kwargs) :
		if self.vis_mode == '2D' :
			trajs = self.periodize_traj(qt)
			for traj in trajs :
				# (r,theta) -> (y,x)
				curve = go.Scatter(x = traj[:,1], y = traj[:,0], mode = 'lines', hoverinfo='none', **kwargs)
				self.current_axis.append(curve)
		elif self.vis_mode == '3D' :
			if type(qt[0]) is not list :
				qt = [qt]
			if self.upsample_trajs :
				qt = list( self.upsample(q) for q in qt )
			traj = list( self.I(q = q) for q in qt )
			separator = array([None]* 3).reshape((1,3))
			traj = vstack( vstack((i, separator)) for i in traj )
			curve = go.Scatter3d(x = traj[:,0], y = traj[:,1], z = traj[:,2], mode = 'lines', hoverinfo='none', **kwargs)
			self.current_axis.append(curve)

	# Vector field display 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:21,代码来源:surface_of_revolution.py

示例2: quiver_3D

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def quiver_3D(self, qt, vt, **kwargs) :
		if qt.shape[1] == 2 :
			Qt = self.I(qt)
			Vt = self.dI(qt, vt)
		elif qt.shape[1] == 3 :
			Qt = qt
			Vt = vt
		
		# quiver3 is not implemented by plotly.js :
		# we have to settle for a poor derivative...
		H = Qt
		T = H + Vt
		arrows = go.Scatter3d(
			x = (hstack(tuple( (H[i,0], T[i,0], None) for i in range(T.shape[0]) ))),
			y = (hstack(tuple( (H[i,1], T[i,1], None) for i in range(T.shape[0]) ))),
			z = (hstack(tuple( (H[i,2], T[i,2], None) for i in range(T.shape[0]) ))),
			mode = 'lines',
			**kwargs
		)
		self.current_axis.append(arrows) 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:22,代码来源:surface_of_revolution.py

示例3: display_scatter_3d_1

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def display_scatter_3d_1(value,figure):
    x, y, z = np.random.multivariate_normal(
     np.array([0, 0, 0]), np.eye(3), 2).transpose()
    figure['data']=[
                    go.Scatter3d(
                        x=x,
                        y=y,
                        z=z,
                        mode='markers',
                    )
                ]
    return figure 
开发者ID:plotly,项目名称:dash-recipes,代码行数:14,代码来源:dash-webgl-contexts.py

示例4: display_scatter_3d_2

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def display_scatter_3d_2(value,figure):
    x, y, z = np.random.multivariate_normal(
     np.array([0, 0, 0]), np.eye(3), 2).transpose()
    figure['data']=[
                    go.Scatter3d(
                        x=x,
                        y=y,
                        z=z,
                        mode='markers',
                    )
                ]
    return figure 
开发者ID:plotly,项目名称:dash-recipes,代码行数:14,代码来源:dash-webgl-contexts.py

示例5: display_scatter_3d_3

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def display_scatter_3d_3(value,figure):
    x, y, z = np.random.multivariate_normal(
     np.array([0, 0, 0]), np.eye(3), 2).transpose()
    figure['data']=[
                    go.Scatter3d(
                        x=x,
                        y=y,
                        z=z,
                        mode='markers',
                    )
                ]
    return figure 
开发者ID:plotly,项目名称:dash-recipes,代码行数:14,代码来源:dash-webgl-contexts.py

示例6: get_trace3d

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def get_trace3d(points3d, point_color=None, line_color=None, name="PointCloud"):
    """Yields plotly traces for visualization."""
    if point_color is None:
        point_color = "rgb(30, 20, 160)"
    if line_color is None:
        line_color = "rgb(30, 20, 160)"
    # Trace of points.
    trace_of_points = go.Scatter3d(
        x=points3d[:, 0],
        y=points3d[:, 2],
        z=points3d[:, 1],
        mode="markers",
        name=name,
        marker=dict(
            symbol="circle",
            size=3,
            color=point_color))

    # Trace of lines.
    xlines = []
    ylines = []
    zlines = []
    for line in CONNECTIONS:
        for point in line:
            xlines.append(points3d[point, 0])
            ylines.append(points3d[point, 2])
            zlines.append(points3d[point, 1])
        xlines.append(None)
        ylines.append(None)
        zlines.append(None)
    trace_of_lines = go.Scatter3d(
        x=xlines,
        y=ylines,
        z=zlines,
        mode="lines",
        name=name,
        line=dict(color=line_color))
    return [trace_of_points, trace_of_lines] 
开发者ID:kongchen1992,项目名称:deep-nrsfm,代码行数:40,代码来源:motion_capture.py

示例7: render

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def render(self):
        """ Plot the figure. Call this last."""
        traces = []
        for dataset in self.xy_datasets:
            kwargs = {}
            if 'name' in dataset and dataset['name'] is not None:
                kwargs['name'] = dataset['name']
                self.zindex = kwargs['name']
            else:
                kwargs['showlegend'] = False
            zvals = np.full(np.size(dataset['x']), self.zindex)
            traces.append(Scatter3d(
                x = dataset['x'],
                z = dataset['y'],
                y = zvals,
                mode = 'lines',
                **kwargs
            ))
            if not isinstance(self.zindex, str):
                self.zindex += 1

        data = Data(traces)
        plotly.offline.iplot({
            'data': data,
            'layout': self.makeLayout()
        }) 
开发者ID:sys-bio,项目名称:tellurium,代码行数:28,代码来源:engine_plotly.py

示例8: scatter_plot3d_plotly

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def scatter_plot3d_plotly(embedding, coloring=None,
                          colorscale='Rainbow', **kwargs):
    import plotly.graph_objs as go
    x,y,z = embedding[:,:3].T
    if isinstance(coloring, str) and coloring.lower() in 'xyz':
        color_idx = 'xyz'.find(coloring)
        coloring = embedding[:,color_idx].flatten()

    marker = kwargs.pop('marker',None)
    name = kwargs.pop('name','Embedding')
    scatter_plot = go.Scatter3d(
        x=x,
        y=y,
        z=z,
        mode='markers',
        marker=dict(
            size=2,
            opacity=0.8,
        ),
        name=name,
        **kwargs
    )
    if coloring is not None:
        scatter_plot['marker'].update(dict(
            color=coloring,
            colorscale=colorscale,
            showscale=True,
        ))
    elif marker is not None:
        scatter_plot['marker'].update(marker)

    return [scatter_plot] 
开发者ID:mmp2,项目名称:megaman,代码行数:34,代码来源:scatter_3d.py

示例9: create_ellipse_mesh

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def create_ellipse_mesh(points,**kwargs):
    """Visualize the ellipse by using the mesh of the points."""
    import plotly.graph_objs as go
    x,y,z = points.T
    return (go.Mesh3d(x=x,y=y,z=z,**kwargs),
            go.Scatter3d(x=x, y=y, z=z,
                         marker=dict(size=0.01),
                         line=dict(width=2,color='#000000'),
                         showlegend=False,
                         hoverinfo='none'
            )
    ) 
开发者ID:mmp2,项目名称:megaman,代码行数:14,代码来源:covar_plotter3.py

示例10: show_glyphs

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def show_glyphs(self, scale = 0.03, axis = 'Z') :
		"Displays triangles on the spherical manifold."
		if self.mode == 'whole sphere' or self.mode == 'spherical blackboard' :
			# We will embed self.triangles in the euclidean space R^3,
			# in the neighborhood of the sphere S(1/2).
			
			if axis == 'X' :
				theta = self.theta
				phi   = self.phi
				e_theta = vstack( ( -sin(theta)        ,  cos(theta) * cos(phi), cos(theta) * sin(phi) ) ).T
				e_phi   = vstack( ( zeros(theta.shape) , -sin(theta) * sin(phi), sin(theta) * cos(phi) ) ).T
			elif axis == 'Z' :
				theta = self.theta_Z
				phi   = self.phi_Z
				e_theta = - vstack( (  cos(theta) * cos(phi), cos(theta) * sin(phi), -sin(theta)         ) ).T
				e_phi   = + vstack( ( - sin(phi),  cos(phi), zeros(theta.shape)  ) ).T
				
			# We don't want glyphs to overlap
			e_theta = scale * e_theta
			e_phi   = scale * e_phi
			
			glyphs = []
			separator = [None, None, None]
			for i in range(self.triangles.shape[0]) :
				point = array([self.X[i], self.Y[i], self.Z[i]])
				glyphs.append(array([
					point + real(self.triangles[i,0]) * e_phi[i] + imag(self.triangles[i,0]) * e_theta[i] , # A
					point + real(self.triangles[i,1]) * e_phi[i] + imag(self.triangles[i,1]) * e_theta[i] , # B
					point + real(self.triangles[i,2]) * e_phi[i] + imag(self.triangles[i,2]) * e_theta[i] , # C
					point + real(self.triangles[i,0]) * e_phi[i] + imag(self.triangles[i,0]) * e_theta[i] , # A
					separator
				]))
			glyphs = vstack(glyphs)
			curves = go.Scatter3d(x = glyphs[:,0], y = glyphs[:,1], z = glyphs[:,2], mode = 'lines', hoverinfo='none', name = 'Triangles')
			self.current_axis.append(curves) 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:37,代码来源:kendall_triangles.py

示例11: marker_3D

# 需要导入模块: from plotly import graph_objs [as 别名]
# 或者: from plotly.graph_objs import Scatter3d [as 别名]
def marker_3D(self, q, **kwargs) :
		if q.shape[1] == 2 :
			Q = self.I(q = q)
		elif q.shape[1] == 3 :
			Q = q
		points = go.Scatter3d(x = Q[:,0], y = Q[:,1], z = Q[:,2], mode = 'markers', hoverinfo='name', **kwargs)
		self.current_axis.append(points) 
开发者ID:jeanfeydy,项目名称:lddmm-ot,代码行数:9,代码来源:surface_of_revolution.py


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