custom_axes3.py 779 B

12345678910111213141516171819202122232425262728
  1. """Customizing Axes.
  2. Cartesian planes can be displaced
  3. from their lower-range default position"""
  4. from vedo import Sphere, Axes, precision, show
  5. sph = Sphere().scale([4, 3, 2]).shift(5, 6, 7).c("green2", 0.1).wireframe()
  6. axs = Axes(
  7. sph, # build axes for object sph
  8. xtitle="x axis",
  9. ytitle="y axis",
  10. ztitle="z axis",
  11. htitle="An ellipsoid at " + precision(sph.center_of_mass(), 2),
  12. htitle_font=1,
  13. htitle_color="red3",
  14. zxgrid=True,
  15. xyframe_line=2,
  16. yzframe_line=2,
  17. zxframe_line=2,
  18. xyframe_color="red3",
  19. yzframe_color="green3",
  20. zxframe_color="blue3",
  21. xyshift=0.2, # move xy plane 20% along z
  22. yzshift=0.2, # move yz plane 20% along x
  23. zxshift=0.2, # move zx plane 20% along y
  24. )
  25. show(sph, axs, __doc__).close()