__plot__(self,
context,
bbox,
palette,
*args,
**kwds)
|
|
Plots the matrix to the given Cairo context in the given box
Besides the usual self-explanatory plotting parameters
(context , bbox , palette ), it
accepts the following keyword arguments:
-
style : the style of the plot. boolean is
useful for plotting matrices with boolean
(True /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. 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 None .
-
square : whether the cells of the matrix should be square
or not. Default is True .
-
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 shown around the
matrix. If zero or negative, the border is turned off. Default is
1 .
-
row_names : the names of the rows
-
col_names : the names of the columns.
-
values : values to be displayed in the cells. If
None or 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 that specifies how the
values should be plotted. 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 "%s" and an implicit
conversion to strings is performed on the elements of the value
matrix.
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.
|