code: def test_rectangle_draw():
      """Test drawing rectangles with transforms using PolygonVisual"""
      pos = np.array(
          [
              [-0.1, 0.5, 0],
              [0.1, 0.5, 0],
              [0.1, -0.5, 0],
              [-0.1, -0.5, 0],
          ]
      )
      with TestingCanvas() as c:
          polygon = visuals.Polygon(
              pos=pos, color=(1, 1, 0, 1), parent=c.scene
          )
          polygon.transform = transforms.STTransform(
              scale=(200.0, 25), translate=(50, 50)
          )
  
          assert_image_approved(c.render(), "visuals/rectangle1.png")
  
          polygon.parent = None
          polygon = visuals.Polygon(
              pos=pos,
              color=(1, 1, 0, 1),
              border_color=(1, 0, 0, 1),
              parent=c.scene,
          )
          polygon.transform = transforms.STTransform(
              scale=(200.0, 25), translate=(50, 50)
          )
  
          assert_image_approved(c.render(), "visuals/rectangle2.png")
  
          polygon.parent = None
          polygon = visuals.Polygon(
              pos=pos,
              border_color=(1, 0, 0, 1),
              border_width=1,
              parent=c.scene,
          )
          polygon.transform = transforms.STTransform(
              scale=(200.0, 25), translate=(50, 49)
          )
  
          assert_image_approved(
              c.render(), "visuals/rectangle3.png", min_corr=0.7
          )
  
imports: import numpy
  from vispy.scene import visuals, transforms
  from vispy.testing import requires_application, requires_scipy, TestingCanvas, run_tests_if_main
  from vispy.testing.image_tester import assert_image_approved
label_desc: Use image node_id 2 for calling a global function with example usage: test_rectangle_draw() without return types