code: def test_scatter_matrix():
      df = pd.DataFrame(
          {"x": range(5), "y": range(5), "label": list("ABABA")}
      )
      # no color or size specified
      plot = pdvega.scatter_matrix(df)
      utils.validate_vegalite(plot)
      spec = plot.to_dict()
      assert spec["repeat"]["row"] == ["x", "y"]
      assert spec["repeat"]["column"] == ["y", "x"]
      assert (
          spec["spec"]["encoding"]["color"]["condition"]["value"]
          == "steelblue"
      )
  
      # with color specified
      plot = pdvega.scatter_matrix(df, c="label")
      utils.validate_vegalite(plot)
      spec = plot.to_dict()
      assert spec["repeat"]["row"] == ["x", "y"]
      assert spec["repeat"]["column"] == ["y", "x"]
      assert (
          spec["spec"]["encoding"]["color"]["condition"]["field"]
          == "label"
      )
  
      # with size specified
      plot = pdvega.scatter_matrix(df, s="label")
      utils.validate_vegalite(plot)
      spec = plot.to_dict()
      assert spec["repeat"]["row"] == ["x", "y"]
      assert spec["repeat"]["column"] == ["y", "x"]
      assert (
          spec["spec"]["encoding"]["color"]["condition"]["value"]
          == "steelblue"
      )
      assert spec["spec"]["encoding"]["size"]["field"] == "label"
  
      # test figsize keyword
      figsize = (8, 6)
      dpi = 40
      ncols = 2
      plot = pdvega.scatter_matrix(df, figsize=figsize, dpi=dpi)
      utils.validate_vegalite(plot)
      spec = plot.to_dict()
      assert np.allclose(
          spec["spec"]["width"], 0.8 * dpi * figsize[0] / ncols
      )
      assert np.allclose(
          spec["spec"]["height"], 0.8 * dpi * figsize[1] / ncols
      )
  
file_path: pdvega/pdvega/tests/test_plotting.py
imports: import pytest
  import numpy
  import pandas
  import pdvega
  from pdvega.tests import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_scatter_matrix() without return types