Printing#

add_margin(pil_img, top, right, bottom, left, color)[source]#

Add margin to the picture

map_diameter(c)[source]#

Compute the diameter

print_map_2d(experiment, return_map: bool = False, xlabel=None, legend_pos=None, title_pos=None, angle=0, reverse: bool = False, update: bool = False, axis: bool = False, textual: list[str] | None = None, textual_size: int = 16, title: str | None = None, bbox_inches='tight', saveas: str | None = None, show: bool = True, tex: bool = False, legend: bool = True, dpi: int = 250, title_size: int = 16, figsize=(6.4, 6.4), pad_inches=None, mask: str | None = None)[source]#

Prints map of instances on a 2d plane.

Parameters:
  • experiment (Experiment) – Experiment object.

  • return_map (bool) – If True then return: fig, ax

  • xlabel – Pyplot param.

  • legend_pos – Pyplot param.

  • title_pos – Pyplot param.

  • angle – Rotate the map by a given angle.

  • reverse (bool) – If True then reverse the map.

  • update (bool) – If True then the points coordinates are exported.

  • axis (bool) – Deprecated param.

  • textual (list[str]) – Print thext over the points with names from the list.

  • textual_size – Size of the ‘textual’ text.

  • title (str) – Pyplot param.

  • bbox_inches – Pyplot param.

  • saveas – Name of file in which the image will be stored.

  • show (bool) – If true show the map on screen.

  • tex (bool) – If True save image in tex format.

  • legend – Pyplot param.

  • dpi (int) – Quality of the image.

  • title_size (int) – Size of the title.

  • figsize – Size of the figure.

  • pad_inches – Pyplot param.

  • mask (str) – Name of the mask to be put on top of the image.

print_map_3d(experiment, xlabel=None, feature_id=None, axis=False, ticks=None, dim=3, title=None, shading=False, saveas='map_3d', show=True, ms=20, normalizing_func=None, xticklabels=None, cmap=None, marker_func=None, tex=False, legend=True, title_pos=None)[source]#

This function is not updated

print_matrix(experiment=None, scale=1.0, rounding=1, saveas=None, show=True, ms=8, title=None, omit=None, self_distances=False, yticks='left', with_std=False, time=False, dpi=100, vmin=None, vmax=None)[source]#

Print the matrix with average distances between each pair of election