Plt

Draw plots.

the_utils.plt.draw_chart(ys: ~typing.List[~typing.List], lbls: ~typing.List[str], y_colors: ~typing.List[str] = None, xs: ~typing.List[~typing.Any] = None, fill_between: ~typing.List = None, fill_colors: ~typing.List[str] = None, fill_alpha: ~typing.List[float] = 0.5, figsize: ~typing.Tuple = (24, 3), xmode: str = 's', ymode: str = 's', title: str = None, set_xticks: bool = False, xticks: ~typing.List[~typing.Any] = None, tick_labels: ~typing.List[~typing.Any] = None, x_rotation: float = 45, boxes: ~typing.List[~typing.List[int]] = None, box_colors: ~typing.List[str] = None, box_alphas: ~typing.List[float] = None, ylim: (<class 'float'>, <class 'float'>) = None, xlim: (<class 'float'>, <class 'float'>) = None, linewidth: ~typing.List[int] = None, types: ~typing.List[str] = 'line', markersize: float = 1.25, save_path: str = None, bar_width: float = 0.25, legend_loc: str = 'center left', legend_bbox_to_anchor: ~typing.Tuple[float] = (1, 0.5)) None[source]

Draw charts.

Parameters:
  • ys (List[List]) – value lists of the y axis.

  • lbls (List[str]) – legend labels of the value lists.

  • y_colors (List[str], optional) – colors of the the ys. Defaults to None.

  • xs (List[Any], optional) – value list of the x axis. If None, idx will be used. Defaults to None.

  • fill_between (List, optional) – fill the range of [ys[idx][i] - fill_between[idx][i], ys[idx][i] + fill_between[idx][i]]. Defaults to None.

  • fill_colors (List[str], optional) – colors of the fill range. Defaults to None.

  • fill_alpha (List[float] or float, optional) – color alphas of the fill range. Defaults to 0.5.

  • figsize (Tuple, optional) – size of the output figure. Defaults to (24, 3).

  • xmode (str, optional) – all ys with the same x (‘s’) or with different xs (‘d’). Defaults to “s”.

  • ymode (str, optional) – all ys with the same tick (‘s’) or with different ticks (‘d’). Defaults to “s”.

  • title (str, optional) – figure title. Defaults to None.

  • set_xticks (bool, optional) – set the x ticks. Defaults to True.

  • xticks (List[Any], optional) – ticks for the x axis. Defaults to None.

  • tick_labels (List[Any], optional) – tick labels for the x axis. Defaults to None.

  • x_rotation (float, optional) – rotation of the x ticks. Defaults to 45.

  • boxes (List[List[int]], optional) – draw boxes. Defaults to None.

  • box_colors (List[str], optional) – colors of the boxes to draw. Defaults to None.

  • box_alpha (List[float], optional) – color alphas of the boxes to draw. Defaults to 0.5.

  • ylim (float, optional) – maximum value of the y axis. Defaults to None.

  • xlim (float, optional) – maximum value of the x axis. Defaults to None.

  • linewidth (List[int], optional) – line width of the line charts to draw. Defaults to None.

  • types (List[str] or str, optional) – types of charts of the ys. Defaults to “line”.

  • markersize (float, optional) – dot size of the scatter charts. Defaults to 1.25.

  • save_path (str, optional) – If not None, save image to the path. Defaults to None.

  • bar_width (float, optional) – width of the bars. Defaults to 0.25.

  • legend_loc (str, optional) – location of the legend. Defaults to “center left”.

  • legend_bbox_to_anchor (Tuple[float], optional) – bbox_to_anchor of the legend. Defaults to (1, 0.5).

Raises:

ValueError – “The arg ‘types:’{types} has values not supported.”