Draws the given Matrix in a Cairo context.
|Parameters||matrix||the igraph.Matrix to plot.|
It accepts the following keyword arguments:
bbox: the bounding box within which we will draw. Can be anything accepted by the constructor of
BoundingBox (i.e., a 2-tuple, a 4-tuple or a
palette: the palette that can be used to map integer color indices to colors when drawing vertices
style: the style of the plot.
boolean is useful for plotting matrices with boolean (
False or 0/1) values:
False will be shown with a white box and
True with a black box.
palette uses the given palette to represent numbers by colors, the minimum will be assigned to palette color index 0 and the maximum will be assigned to the length of the palette.
None draws transparent cell backgrounds only. The default style is
boolean (but it may change in the future).
None values in the matrix are treated specially in both cases: nothing is drawn in the cell corresponding to
square: whether the cells of the matrix should be square or not. Default is
grid_width: line width of the grid shown on the matrix. If zero or negative, the grid is turned off. The grid is also turned off if the size of a cell is less than three times the given line width. Default is
1. Fractional widths are also allowed.
border_width: line width of the border drawn around the matrix. If zero or negative, the border is turned off. Default is
row_names: the names of the rows
col_names: the names of the columns.
values: values to be displayed in the cells. If
False, no values are displayed. If
True, the values come from the matrix being plotted. If it is another matrix, the values of that matrix are shown in the cells. In this case, the shape of the value matrix must match the shape of the matrix being plotted.
value_format: a format string or a callable that specifies how the values should be plotted. If it is a callable, it must be a function that expects a single value and returns a string. Example:
"%#.2f" for floating-point numbers with always exactly two digits after the decimal point. See the Python documentation of the
% operator for details on the format string. If the format string is not given, it defaults to the
If only the row names or the column names are given and the matrix is square-shaped, the same names are used for both column and row names.