Reference 〉 Function

AgentsPlot.config(paramstr|dict, valstr|num|boolNone)

Sets options for the spatial plot. One argument will return the value; two arguments sets the parameter. Config options are:

  • patchColormap (str): The name of a Matplotlib colormap for coloring the patches. Default: 'blues'
  • patchProperty (str): The name of a property to which the colormap should correspond. For example, The default value of 'mapcolor' for example means that patch color will represent the patch’s value of Patch.mapcolor, which can be set in the patchStep hook. If the string is formatted 'good:goodname', patch colors will represent the patch’s stocks of the good represented by goodname. If this parameter is left unset, the patch map will remain white. Default: None
  • patchAspect (num): The aspect ratio of the patches. >1 is taller, <1 is wider. Note that this doesn’t affect the coordinates; only the display of the map, and only in the spatial layout. Default: 1
  • agentMarker (str): a string representing the Matplotlib marker to be used to represent agents on the map. Default: 'o'
  • agentSize (int|str): If an integer, sets the size of the marker used to represent agents. If a string, represents an agent property or the stocks of a good to size the agent by, identically to patchProperty. Default: 5
  • agentLabel (bool|str): If False, agents are drawn with no text label. If True, agents are drawn labelled with agent.id. If a string, corresponds to the name of an agent property that should be used for the label. The value of a stock of goods can be used for the label by prefixing the string like 'good:goodname', similar to the patchProperty parameter. Default: False
  • labelSize (num), labelColor (str), labelFamily (str), labelWeight (str), labelAlpha (num), labelAlign (str), and labelVerticalAlign (str): Various paramters to control the appearance of the labels. These parameters are passed to networkx.draw_network_labels() if agentLabel != False. Default: 10, 'k', 'sans-serif', 'normal', None, 'center', and 'center'
  • lockLayout (bool): If True, disables rotating the network layout. Default: False
  • mapBg (str): The background color of the map that shows through when patches die. Default: 'black'
  • regLine (bool|str): Whether to draw a best-fit regression line in scatterplot layout. Can take True or a Matplotlib line style (e.g. 'solid', 'dashed', etc.). Default: 'dashed'
  • regColor (str): The color of the regression line in scatterplot layout. Default: 'red'
  • regWidth (num): The width of the regression line in scatterplot layout. Default: 1

Parameters

  • param str|dict, required

    The parameter name to set or get, depending on if the second argument is set. Can also receive a dict of key-value pairs to set multiple parameters at once.

  • val str|num|bool, optional

    The value to set the parameter to.

    Default value: None

Return Value str|num|bool

The value of the parameter, if param was a string and val is not set, otherwise None.

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.

History