parameters: (source, parameter=None, mask=None, edges=[-0.5, 0.5, -0.5, 0.5], shape=[100, 100],
                               ax=None, prob_cmap='Greens', mask_color='yellow')
docstring: Create a plot of the connection probability and/or mask.
  
      A probability plot is created based on a `Parameter` and a `source`. The
      `Parameter` should have a distance dependency. The `source` must be given
      as a `NodeCollection` with a single node ID. Optionally a `mask` can also be
      plotted.
  
      Parameters
      ----------
      source : NodeCollection
          Single node ID `NodeCollection` to use as source.
      parameter : Parameter
          `Parameter` the probability is based on.
      mask : Dictionary
          Optional specification of a connection mask. Connections will only
          be made to nodes inside the mask. See :py:func:`.CreateMask` for options on
          how to specify the mask.
      edges : list/tuple
          List of four edges of the region to plot. The values are given as
          [x_min, x_max, y_min, y_max].
      shape : list/tuple
          Number of `Parameter` values to calculate in each direction.
      ax : matplotlib.axes.AxesSubplot,
          A matplotlib axes instance to plot in. If none is given,
          a new one is created.
docstring_summary: Create a plot of the connection probability and/or mask.
docstring_tokens: Create a plot of the connection probability and / or mask .
function: def PlotProbabilityParameter(source, parameter=None, mask=None, edges=[-0.5, 0.5, -0.5, 0.5], shape=[100, 100],
                               ax=None, prob_cmap='Greens', mask_color='yellow'):
      """
      Create a plot of the connection probability and/or mask.
  
      A probability plot is created based on a `Parameter` and a `source`. The
      `Parameter` should have a distance dependency. The `source` must be given
      as a `NodeCollection` with a single node ID. Optionally a `mask` can also be
      plotted.
  
      Parameters
      ----------
      source : NodeCollection
          Single node ID `NodeCollection` to use as source.
      parameter : Parameter
          `Parameter` the probability is based on.
      mask : Dictionary
          Optional specification of a connection mask. Connections will only
          be made to nodes inside the mask. See :py:func:`.CreateMask` for options on
          how to specify the mask.
      edges : list/tuple
          List of four edges of the region to plot. The values are given as
          [x_min, x_max, y_min, y_max].
      shape : list/tuple
          Number of `Parameter` values to calculate in each direction.
      ax : matplotlib.axes.AxesSubplot,
          A matplotlib axes instance to plot in. If none is given,
          a new one is created.
      """
  
      # import pyplot here and not at toplevel to avoid preventing users
      # from changing matplotlib backend after importing nest
      import matplotlib.pyplot as plt
  
      if not HAVE_MPL:
          raise ImportError('Matplotlib could not be imported')
  
      if parameter is None and mask is None:
          raise ValueError('At least one of parameter or mask must be specified')
      if ax is None:
          fig, ax = plt.subplots()
      ax.set_xlim(*edges[:2])
      ax.set_ylim(*edges[2:])
  
      if parameter is not None:
          z = np.zeros(shape[::-1])
          for i, x in enumerate(np.linspace(edges[0], edges[1], shape[0])):
              positions = [[x, y] for y in np.linspace(edges[2], edges[3], shape[1])]
              values = parameter.apply(source, positions)
              z[:, i] = np.array(values)
          img = ax.imshow(np.minimum(np.maximum(z, 0.0), 1.0), extent=edges,
                          origin='lower', cmap=prob_cmap, vmin=0., vmax=1.)
          plt.colorbar(img, ax=ax, fraction=0.046, pad=0.04)
  
      if mask is not None:
          periodic = source.spatial['edge_wrap']
          extent = source.spatial['extent']
          source_pos = GetPosition(source)
          patches = _create_mask_patches(mask, periodic, extent, source_pos, face_color=mask_color)
          for patch in patches:
              patch.set_zorder(0.5)
              ax.add_patch(patch)
function_tokens: def PlotProbabilityParameter ( source , parameter = None , mask = None , edges = [ - 0.5 , 0.5 , - 0.5 , 0.5 ] , shape = [ 100 , 100 ] , ax = None , prob_cmap = 'Greens' , mask_color = 'yellow' ) : # import pyplot here and not at toplevel to avoid preventing users # from changing matplotlib backend after importing nest import matplotlib . pyplot as plt if not HAVE_MPL : raise ImportError ( 'Matplotlib could not be imported' ) if parameter is None and mask is None : raise ValueError ( 'At least one of parameter or mask must be specified' ) if ax is None : fig , ax = plt . subplots ( ) ax . set_xlim ( * edges [ : 2 ] ) ax . set_ylim ( * edges [ 2 : ] ) if parameter is not None : z = np . zeros ( shape [ : : - 1 ] ) for i , x in enumerate ( np . linspace ( edges [ 0 ] , edges [ 1 ] , shape [ 0 ] ) ) : positions = [ [ x , y ] for y in np . linspace ( edges [ 2 ] , edges [ 3 ] , shape [ 1 ] ) ] values = parameter . apply ( source , positions ) z [ : , i ] = np . array ( values ) img = ax . imshow ( np . minimum ( np . maximum ( z , 0.0 ) , 1.0 ) , extent = edges , origin = 'lower' , cmap = prob_cmap , vmin = 0. , vmax = 1. ) plt . colorbar ( img , ax = ax , fraction = 0.046 , pad = 0.04 ) if mask is not None : periodic = source . spatial [ 'edge_wrap' ] extent = source . spatial [ 'extent' ] source_pos = GetPosition ( source ) patches = _create_mask_patches ( mask , periodic , extent , source_pos , face_color = mask_color ) for patch in patches : patch . set_zorder ( 0.5 ) ax . add_patch ( patch )