code: def test_text_position():
      # Test the labels text and position of the axis depending on its domain
  
      canvas = scene.SceneCanvas(keys=None, size=(800, 600), show=True)
      view = canvas.central_widget.add_view()
      view.camera = scene.cameras.PanZoomCamera(parent=view.scene)
  
      # tick length and label margin to 0 for nice values
      axis1 = visuals.Axis(
          pos=[[-1.0, 0], [1.0, 0]],
          domain=(0.0, 1.25),
          major_tick_length=0,
          tick_label_margin=0,
          parent=view.scene,
      )
  
      canvas.draw_visual(axis1)
      assert_allclose(axis1._text.pos[:, 0], (-1, -0.2, 0.6))
      assert_array_equal(axis1._text.text, ("0", "0.5", "1"))
  
      # Flip the axis domain
      axis1.domain = (1.25, 0.0)
      canvas.draw_visual(axis1)
      # Text should be unchanged and positions mirrored
      assert_allclose(axis1._text.pos[:, 0], (1, 0.2, -0.6))
      assert_array_equal(axis1._text.text, ("0", "0.5", "1"))
  
file_path: vispy/vispy/visuals/tests/test_axis.py
imports: from numpy.testing import assert_allclose, assert_array_equal
  from vispy import scene
  from vispy.scene import visuals
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main
label_desc: Use image node_id 4 for calling a global function with example usage: test_text_position() without return types