File: custom_axes3.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 779 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Customizing Axes.
Cartesian planes can be displaced
from their lower-range default position"""
from vedo import Sphere, Axes, precision, show

sph = Sphere().scale([4, 3, 2]).shift(5, 6, 7).c("green2", 0.1).wireframe()

axs = Axes(
    sph,  # build axes for object sph
    xtitle="x axis",
    ytitle="y axis",
    ztitle="z axis",
    htitle="An ellipsoid at " + precision(sph.center_of_mass(), 2),
    htitle_font=1,
    htitle_color="red3",
    zxgrid=True,
    xyframe_line=2,
    yzframe_line=2,
    zxframe_line=2,
    xyframe_color="red3",
    yzframe_color="green3",
    zxframe_color="blue3",
    xyshift=0.2,  # move xy plane 20% along z
    yzshift=0.2,  # move yz plane 20% along x
    zxshift=0.2,  # move zx plane 20% along y
)

show(sph, axs, __doc__).close()