Привет, я хочу использовать майави для визуализации данных в структурированной сетке в плоскости разреза.Как удалить красную рамку и белую стрелку в scalar_cut_plane при использовании mayavi?
Чтобы проиллюстрировать это, я следующий код, полученный из http://docs.enthought.com/mayavi/mayavi/auto/example_structured_grid.html, написанного Эрика Джонс
#!/usr/bin/env python
import numpy as np
from numpy import cos, sin, pi
from tvtk.api import tvtk
from mayavi import mlab
def generate_annulus(r=None, theta=None, z=None):
# Find the x values and y values for each plane.
x_plane = (cos(theta)*r[:,None]).ravel()
y_plane = (sin(theta)*r[:,None]).ravel()
# Allocate an array for all the points. We'll have len(x_plane)
# points on each plane, and we have a plane for each z value, so
# we need len(x_plane)*len(z) points.
points = np.empty([len(x_plane)*len(z),3])
# Loop through the points for each plane and fill them with the
# correct x,y,z values.
start = 0
for z_plane in z:
end = start + len(x_plane)
# slice out a plane of the output points and fill it
# with the x,y, and z values for this plane. The x,y
# values are the same for every plane. The z value
# is set to the current z
plane_points = points[start:end]
plane_points[:,0] = x_plane
plane_points[:,1] = y_plane
plane_points[:,2] = z_plane
start = end
return points
# Make the data.
dims = (51, 25, 25)
# The coordinates
theta = np.linspace(0, 2*np.pi, dims[0])
# 'y' corresponds to varying 'r'
r = np.linspace(1, 10, dims[1])
z = np.linspace(0, 5, dims[2])
pts = generate_annulus(r, theta, z)
# Make the grid
sgrid = tvtk.StructuredGrid(dimensions=dims)
sgrid.points = pts
s = np.sqrt(pts[:,0]**2 + pts[:,1]**2 + pts[:,2]**2)
sgrid.point_data.scalars = np.ravel(s.copy())
sgrid.point_data.scalars.name = 'scalars'
d = mlab.pipeline.add_dataset(sgrid)
mlab.pipeline.scalar_cut_plane(d)
mlab.show()
Однако, я хотел бы избавиться от назойливой красной рамки и белой стрелки при сохранении сюжета. Как мне это сделать?
Сначала я попытался использовать модуль mlab.pipeline.scalar_field, но я получил сообщение об ошибке, указывающее, что мне нужно указать данные в виде массива. Я также искал gui, чтобы увидеть, есть ли где-нибудь я могу отключить это, но я не могу найти его