Example #1
0
def test_labels():
    f = p3.figure()
    p3.xlabel("x1")
    p3.ylabel("y1")
    p3.zlabel("z1")
    assert f.xlabel == "x1"
    assert f.ylabel == "y1"
    assert f.zlabel == "z1"
    p3.xyzlabel("x2", "y2", "z2")
    assert f.xlabel == "x2"
    assert f.ylabel == "y2"
    assert f.zlabel == "z2"
Example #2
0
# create ipyvolume figure to display cylinder and coordinate frame transform animation
fig = p3.figure(width=480, height=480)

# set ipyvolume style properties
p3.style.background_color('black')
p3.style.box_off()
p3.style.use("dark")
p3.style.use({'xaxis.color': "red"})  # <-+
p3.style.use({'yaxis.color': "green"})  # <-+- do not appear to be working
p3.style.use({'zaxis.color': "blue"})  # <-+

# set figure view and axes
p3.view(0.0, -120.0)
p3.xyzlim(-2.0, 2.0)
p3.xyzlabel('X', 'Y', 'Z')

# coordinate frame axes line segments
Lx = p3.plot(Xf[:, 0:2, 0], Yf[:, 0:2, 0], Zf[:, 0:2, 0], color='red', size=2)
Lx.material.visible = False
Lx.line_material.visible = True
Ly = p3.plot(Xf[:, 0:2, 1], Yf[:, 0:2, 1], Zf[:, 0:2, 1], color='green')
Ly.material.visible = False
Ly.line_material.visible = True
Lz = p3.plot(Xf[:, 0:2, 2], Yf[:, 0:2, 2], Zf[:, 0:2, 2], color='blue')
Lz.material.visible = False
Lz.line_material.visible = True

# coordinate frame axes line segment tip arrows
Xfv = Xf[:, 1, :] - Xf[:, 0, :]
Yfv = Yf[:, 1, :] - Yf[:, 0, :]