本文整理汇总了Python中vispy.scene.visuals.Markers方法的典型用法代码示例。如果您正苦于以下问题:Python visuals.Markers方法的具体用法?Python visuals.Markers怎么用?Python visuals.Markers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vispy.scene.visuals
的用法示例。
在下文中一共展示了visuals.Markers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def __init__(self, layer):
# Create a compound visual with the following four subvisuals:
# Markers: corresponding to the vertices of the interaction box or the
# shapes that are used for highlights.
# Lines: The lines of the interaction box used for highlights.
# Mesh: The mesh of the outlines for each shape used for highlights.
# Mesh: The actual meshes of the shape faces and edges
node = Compound([Mesh(), Mesh(), Line(), Markers()])
super().__init__(layer, node)
self.layer.events.edge_width.connect(self._on_slice_data_change)
self.layer.events.edge_color.connect(self._on_slice_data_change)
self.layer.events.face_color.connect(self._on_slice_data_change)
self.layer.events.highlight.connect(self._on_highlight_change)
self._reset_base()
self._on_slice_data_change()
self._on_highlight_change()
示例2: __init__
# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def __init__(self, keyupdateCB):
scene.SceneCanvas.__init__(self, keys=None)
self.size = 800, 600
self.unfreeze()
self.view = self.central_widget.add_view()
self.view.bgcolor = '#ffffff'
self.view.camera = TurntableCamera(
fov=10.0, distance=30.0, up='+z', center=(0.0, 0.0, 0.0))
self.last_pos = [0, 0, 0]
self.pos_markers = visuals.Markers()
self.meas_markers = visuals.Markers()
self.pos_data = np.array([0, 0, 0], ndmin=2)
self.meas_data = np.array([0, 0, 0], ndmin=2)
self.lines = []
self.view.add(self.pos_markers)
self.view.add(self.meas_markers)
for i in range(6):
line = visuals.Line()
self.lines.append(line)
self.view.add(line)
self.keyCB = keyupdateCB
self.freeze()
scene.visuals.XYZAxis(parent=self.view.scene)
示例3: add_chan
# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def add_chan(self, chan, color=None, values=None, limits_c=None,
colormap=CHAN_COLORMAP, alpha=None, colorbar=False):
"""Add channels to visualization
Parameters
----------
chan : instance of Channels
channels to plot
color : tuple
3-, 4-element tuple, representing RGB and alpha, between 0 and 1
values : ndarray
array with values for each channel
limits_c : tuple of 2 floats, optional
min and max values to normalize the color
colormap : str
one of the colormaps in vispy
alpha : float
transparency (0 = transparent, 1 = opaque)
colorbar : bool
add a colorbar at the back of the surface
"""
# reuse previous limits
if limits_c is None and self._chan_limits is not None:
limits_c = self._chan_limits
chan_colors, limits = _prepare_colors(color=color, values=values,
limits_c=limits_c,
colormap=colormap, alpha=alpha,
chan=chan)
self._chan_limits = limits
xyz = chan.return_xyz()
marker = Markers()
marker.set_data(pos=xyz, size=CHAN_SIZE, face_color=chan_colors)
self._add_mesh(marker)
if colorbar:
self._view.add(_colorbar_for_surf(colormap, limits))