def test_doc_10(self): import vtkplotlib as vpl import numpy as np # Create a ball at a point in space. point = np.array([1, 2, 3]) vpl.scatter(point) vpl.annotate(point, "This ball is at {}".format(point), np.array([0, 0, 1]))
def test_annotate(): point = np.array([1, 2, 3]) vpl.scatter(point) arrow, self = vpl.annotate(point, point, np.array([0, 0, 1]), text_color="green", arrow_color="purple")
def test_annotate(): point = np.array([1, 2, 3]) vpl.scatter(point) arrow, self = vpl.annotate(point, point, np.array([0, 0, 1]), text_color="green", arrow_color="purple") assert np.all(self.color == vpl.colors.as_rgb_a("green")[0]) assert self.text == str(point) assert (self.position - point == (0, 0, 3)).all() assert np.all(arrow.color == vpl.colors.as_rgb_a("purple")[0])
def test_doc_11(self): import vtkplotlib as vpl import numpy as np # Create several balls. points = np.random.uniform(-30, 30, (30, 3)) vpl.scatter(points, color=np.random.random(points.shape)) vpl.annotate(points, "This ball is the highest", np.array([0, 0, 1]), text_color="k", arrow_color="orange") vpl.annotate(points, "This ball is the lowest", np.array([0, 0, -1]), text_color="rust", arrow_color="hunter green")
def test(): import vtkplotlib as vpl # self = vpl.text3d("some text", follow_cam=True) point = np.array([1, 2, 3]) vpl.scatter(point) arrow, text = vpl.annotate(point, point, np.array([0, 0, 1])) globals().update(locals()) vpl.show()