baikit.PlotData

class baikit.PlotData(plot_title, manifest_dir='input/manifest/')

Bases: Data

Plot figure

Plots figure of 2-D data.

plot_figsize

Default: (6.4, 4.8)

Type:

tuple

plot_title_flag

Default: False

Type:

bool

plot_title
Type:

str

plot_title_fontsize

Default: 14

Type:

float

plot_xlabel

Default: “”

Type:

str

plot_ylabel

Default: “”

Type:

str

plot_label_fontsize

Default: 18

Type:

float

subplots_layout

Default: numpy.array([[2 * x - 1, 2 * x] for x in range(4, 0, -1)]).reshape(4, 1, 2)

Type:

numpy.ndarray

subplots_tag

Default: numpy.array([f”example_{x}” for x in range(4, 0, -1)]).reshape(4, 1)

Type:

numpy.ndarray

subplots_annotate_xyoffset

Default: numpy.tile([0, -12], (4, 1, 2, 1))

Type:

numpy.ndarray

subplots_wspace

Default: 0

Type:

float

subplots_hspace

Default: 0

Type:

float

subplot_xlim

Default: []

Type:

list

subplot_ylim

Default: []

Type:

list

subplot_ylim_offset

Default: 0

Type:

float

subplot_xlabel

Default: “”

Type:

list

subplot_ylabel_flag

Default: True

Type:

bool

subplot_xscale

Default: “linear”

Type:

list

subplot_yscale

Default: “linear”

Type:

list

subplot_linewidth

Default: 1.5

Type:

float

subplot_legend_flag

Default: False

Type:

bool

subplot_legend_loc

Default: “best”

Type:

str

subplot_legend_fontsize

Default: 10

Type:

float

line_ystep

Default: 0

Type:

float

line_annotate_flag

Default: False

Type:

bool

line_annotate_x

The x position of the annotation. Default: 1200

Type:

float

line_annotate_interval

The x interval of the data. Default: 2

Type:

float

line_annotate_kwargs

Default: {“textcoords”: “offset points”, “horizontalalignment”: “center”, “fontsize”: 12, “bbox”: dict(boxstyle=”square”, alpha=0.8, ec=”w”, fc=”w”)}

Type:

dict

line_print_flag

Default: True

Type:

bool

persistent_styles_flag

Default: False

Type:

bool

persistent_styles

Default: defaultdict(lambda: next(loop_cy_iter))

Type:

dict

__init__(plot_title, manifest_dir='input/manifest/')
Parameters:
  • plot_title (str) – Plot title which is also manifest filename.

  • manifest_dir (str, optional) – Manifest directory. Default: “input/manifest/”

Methods

__init__(plot_title[, manifest_dir])

param plot_title:

Plot title which is also manifest filename.

init_figure()

Initialise figure

line(manifest_line_index, i, j, its)

Plot line

load_manifest()

Load manifest

plot_subplots()

Wrapper of subplot_lines()

save_figure()

Save figure

subplot_lines(i, j, its)

Wrapper of line()

init_figure()

Initialise figure

Creates subplots with axes.

subplots_shape
Type:

numpy.ndarray

manifest_lines_fields
Type:

numpy.ndarray

subplot_x_tick_params

Default: {“which”: “both”, “direction”: “in”, “width”: self.subplot_linewidth, “labelsize”: 15, “bottom”: True, “top”: False, “labelbottom”: True}

Type:

dict

subplot_y_tick_params

Default: {“which”: “both”, “direction”: “in”, “width”: self.subplot_linewidth, “labelsize”: 15, “left”: False, “right”: False, “labelleft”: False}

Type:

dict

fig
Type:

Figure

gs
Type:

GridSpec

axs

List of Axes.

Type:

list

subplot_cycler

Default: (cycler(color=palettable.tableau.Tableau_10.mpl_colors) * cycler(linewidth=[1.5]) * cycler(markersize=[5]))

Type:

Cycler

save_figure()

Save figure

Saves current figure to output folder, with some settings.

plot_subplots()

Wrapper of subplot_lines()

Plots subplots.

subplot_lines(i, j, its)

Wrapper of line()

Wraps lines into a subplot.

Parameters:
  • i (int) – Row number of subplot grid.

  • j (int) – Column number of subplot grid.

  • its (numpy.ndarray) – Iteration numbers.

line(manifest_line_index, i, j, its) ndarray

Plot line

Plots an ndarray of 2-D data.

Parameters:
  • manifest_line_index (int) – Row number of manifest line.

  • i (int) – Row number of subplot grid.

  • j (int) – Column number of subplot grid.

  • its (numpy.ndarray) – Iteration numbers.

Returns:

Iteration numbers.

Return type:

numpy.ndarray