class documentation

默认的Cairo绘图对象用于树状图。

方法 __init__ 构造绘图器并将其与给定的调色板关联。
方法 draw 在Cairo上下文中绘制给定的树状图。
实例变量 palette 未记录
静态方法 _item_box_size 计算在树状图底部绘制单个顶点所需的空间量。
方法 _plot_item 将树状图项目绘制到给定的Cairo上下文中

继承自 AbstractCairoDrawer:

方法 bbox.setter 设置此绘图器将绘制的绘图区域的边界框。
实例变量 context 未记录
属性 bbox 此绘图器将绘制的绘图区域的边界框。
方法 _mark_point 在画布上用一个小圆圈标记给定的点。主要用于调试目的。
实例变量 _bbox 未记录
def __init__(self, context, bbox, palette): (source)

构建抽屉并将其关联到给定的调色板。

参数
context我们将绘制的上下文
bbox我们将在此边界框内绘制。可以是BoundingBox构造函数接受的任何内容(即,一个2元组,一个4元组或一个BoundingBox对象)。
palette绘制顶点时可用于将整数颜色索引映射到颜色的调色板
def draw(self, dendro, **kwds): (source)

在Cairo上下文中绘制给定的树状图。

参数
dendro

the igraph.Dendrogram to plot.

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. 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 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 drawn 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 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 str function.

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.

**kwds未记录

未记录

@staticmethod
def _item_box_size(dendro, context, horiz, idx): (source)

计算在树状图底部绘制单个顶点所需的空间量。

def _plot_item(self, dendro, context, horiz, idx, x, y): (source)

将树状图项目绘制到给定的Cairo上下文中

参数
dendro未记录
context我们正在绘制的Cairo上下文
horiz树状图是否水平定向
idx项目的索引
x项目的X位置
y项目的Y位置