class_docstr: !
  @brief Visualizer of output dynamic of sync network (Sync).
docstr: !
  @brief Shows 2D matrix of phase values of oscillators at the specified iteration.
  @details User should ensure correct matrix sizes in line with following expression grid_width x grid_height that should be equal to 
            amount of oscillators otherwise exception is thrown. If grid_width or grid_height are not specified than phase matrix size 
            will by calculated automatically by square root.
  
  @param[in] sync_output_dynamic (sync_dynamic): Output dynamic of the Sync network whose phase matrix should be shown.
  @param[in] grid_width (uint): Width of the phase matrix.
  @param[in] grid_height (uint): Height of the phase matrix.
  @param[in] iteration (uint): Number of iteration of simulation for which correlation matrix should be allocated.
              If iternation number is not specified, the last step of simulation is used for the matrix allocation.
docstr_tok: ["!","@","brief","Shows","2D","matrix","of","phase","values","of","oscillators","at","the","specified","iteration",".","@","details","User","should","ensure","correct","matrix","sizes","in","line","with","following","expression","grid_width","x","grid_height","that","should","be","equal","to","amount","of","oscillators","otherwise","exception","is","thrown",".","If","grid_width","or","grid_height","are","not","specified","than","phase","matrix","size","will","by","calculated","automatically","by","square","root",".","@","param","[","in","]","sync_output_dynamic","(","sync_dynamic",")",":","Output","dynamic","of","the","Sync","network","whose","phase","matrix","should","be","shown",".","@","param","[","in","]","grid_width","(","uint",")",":","Width","of","the","phase","matrix",".","@","param","[","in","]","grid_height","(","uint",")",":","Height","of","the","phase","matrix",".","@","param","[","in","]","iteration","(","uint",")",":","Number","of","iteration","of","simulation","for","which","correlation","matrix","should","be","allocated",".","If","iternation","number","is","not","specified",",","the","last","step","of","simulation","is","used","for","the","matrix","allocation","."]
code: def show_phase_matrix(
      sync_output_dynamic,
      grid_width=None,
      grid_height=None,
      iteration=None,
  ):
      """!
      @brief Shows 2D matrix of phase values of oscillators at the specified iteration.
      @details User should ensure correct matrix sizes in line with following expression grid_width x grid_height that should be equal to
                amount of oscillators otherwise exception is thrown. If grid_width or grid_height are not specified than phase matrix size
                will by calculated automatically by square root.
  
      @param[in] sync_output_dynamic (sync_dynamic): Output dynamic of the Sync network whose phase matrix should be shown.
      @param[in] grid_width (uint): Width of the phase matrix.
      @param[in] grid_height (uint): Height of the phase matrix.
      @param[in] iteration (uint): Number of iteration of simulation for which correlation matrix should be allocated.
                  If iternation number is not specified, the last step of simulation is used for the matrix allocation.
  
      """
      phase_matrix = sync_output_dynamic.allocate_phase_matrix(
          grid_width, grid_height, iteration
      )
  
      figure, axes = plt.subplots(1)
      axes.imshow(
          phase_matrix,
          cmap=plt.get_cmap("jet"),
          interpolation="kaiser",
          vmin=0.0,
          vmax=2.0 * math.pi,
      )
      plt.show()
      plt.close(figure)
  
imports: import math
  import numpy
  import random
  import matplotlib.pyplot
  import matplotlib.animation
  import pyclustering.core.sync_wrapper
  from pyclustering.core.wrapper import ccore_library
  from scipy.integrate import odeint
  from pyclustering.nnet import network, conn_represent, conn_type, initial_type, solve_type
  from pyclustering.utils import pi, draw_dynamics, draw_dynamics_set, set_ax_param
label_desc: Use image node_id 4 for calling the sync_visualizer obj's underlying member method code with example usage: obj.show_phase_matrix(sync_output_dynamic, grid_width, grid_height, iteration) without return types