parameters: (workspace, distribution, histogram2D=False, transpose=False)
docstring: Get all data from a Matrix workspace that has the same number of bins
      in every spectrum. It is used for 2D plots
  
      :param workspace: Matrix workspace to extract the data from
      :param distribution: if False, and the workspace contains histogram data,
          the intensity will be divided by the x bin width
  
      :param histogram2D: flag that specifies if the coordinates in the output are
          -bin centers (such as for contour) for False, or
          -bin edges (such as for pcolor) for True.
  
      Returns x,y,z 2D arrays
docstring_summary: Get all data from a Matrix workspace that has the same number of bins
      in every spectrum. It is used for 2D plots
docstring_tokens: Get all data from a Matrix workspace that has the same number of bins in every spectrum . It is used for 2D plots
function: def get_matrix_2d_data(workspace, distribution, histogram2D=False, transpose=False):
      '''
      Get all data from a Matrix workspace that has the same number of bins
      in every spectrum. It is used for 2D plots
  
      :param workspace: Matrix workspace to extract the data from
      :param distribution: if False, and the workspace contains histogram data,
          the intensity will be divided by the x bin width
  
      :param histogram2D: flag that specifies if the coordinates in the output are
          -bin centers (such as for contour) for False, or
          -bin edges (such as for pcolor) for True.
  
      Returns x,y,z 2D arrays
      '''
      try:
          workspace.blocksize()
      except RuntimeError:
          raise ValueError('The spectra are not the same length. Try using pcolor, pcolorfast, or pcolormesh instead')
      x = workspace.extractX()
      if workspace.getAxis(1).isText():
          nhist = workspace.getNumberHistograms()
          y = np.arange(nhist)
      else:
          y = workspace.getAxis(1).extractValues()
      z = workspace.extractY()
  
      try:
          specInfo = workspace.spectrumInfo()
          for index in range(workspace.getNumberHistograms()):
              if specInfo.isMasked(index) or specInfo.isMonitor(index):
                  z[index, :] = np.nan
      except:
          pass
  
      if workspace.isHistogramData():
          if not distribution:
              z /= x[:, 1:] - x[:, 0:-1]
          if histogram2D:
              if len(y) == z.shape[0]:
                  y = boundaries_from_points(y)
              x = np.vstack((x, x[-1]))
          else:
              x = .5 * (x[:, 0:-1] + x[:, 1:])
              if len(y) == z.shape[0] + 1:
                  y = points_from_boundaries(y)
      else:
          if histogram2D:
              if common_x(x):
                  x = np.tile(boundaries_from_points(x[0]), z.shape[0] + 1).reshape(z.shape[0] + 1, -1)
              else:
                  x = np.vstack((x, x[-1]))
                  x = np.array([boundaries_from_points(xi) for xi in x])
              if len(y) == z.shape[0]:
                  y = boundaries_from_points(y)
          else:
              if len(y) == z.shape[0] + 1:
                  y = points_from_boundaries(y)
      y = np.tile(y, x.shape[1]).reshape(x.shape[1], x.shape[0]).transpose()
      z = np.ma.masked_invalid(z)
      if transpose:
          return y.T, x.T, z.T
      else:
          return x, y, z
function_tokens: def get_matrix_2d_data ( workspace , distribution , histogram2D = False , transpose = False ) : try : workspace . blocksize ( ) except RuntimeError : raise ValueError ( 'The spectra are not the same length. Try using pcolor, pcolorfast, or pcolormesh instead' ) x = workspace . extractX ( ) if workspace . getAxis ( 1 ) . isText ( ) : nhist = workspace . getNumberHistograms ( ) y = np . arange ( nhist ) else : y = workspace . getAxis ( 1 ) . extractValues ( ) z = workspace . extractY ( ) try : specInfo = workspace . spectrumInfo ( ) for index in range ( workspace . getNumberHistograms ( ) ) : if specInfo . isMasked ( index ) or specInfo . isMonitor ( index ) : z [ index , : ] = np . nan except : pass if workspace . isHistogramData ( ) : if not distribution : z /= x [ : , 1 : ] - x [ : , 0 : - 1 ] if histogram2D : if len ( y ) == z . shape [ 0 ] : y = boundaries_from_points ( y ) x = np . vstack ( ( x , x [ - 1 ] ) ) else : x = .5 * ( x [ : , 0 : - 1 ] + x [ : , 1 : ] ) if len ( y ) == z . shape [ 0 ] + 1 : y = points_from_boundaries ( y ) else : if histogram2D : if common_x ( x ) : x = np . tile ( boundaries_from_points ( x [ 0 ] ) , z . shape [ 0 ] + 1 ) . reshape ( z . shape [ 0 ] + 1 , - 1 ) else : x = np . vstack ( ( x , x [ - 1 ] ) ) x = np . array ( [ boundaries_from_points ( xi ) for xi in x ] ) if len ( y ) == z . shape [ 0 ] : y = boundaries_from_points ( y ) else : if len ( y ) == z . shape [ 0 ] + 1 : y = points_from_boundaries ( y ) y = np . tile ( y , x . shape [ 1 ] ) . reshape ( x . shape [ 1 ] , x . shape [ 0 ] ) . transpose ( ) z = np . ma . masked_invalid ( z ) if transpose : return y . T , x . T , z . T else : return x , y , z