spellbook.plotutils#

Helper functions used by the other plotting modules

Functions:

categorybox(ax, text[, x, y, alignment, ...])

param ax

get_data_kind(var)

Determine the datakind of a pandas.Series

legend_bbox_to_anchor([align])

legend_loc([align])

not_yet_implemented(fig, grid, gridindex, ...)

print_data_kinds(data)

Print datakinds for all columns in the dataframe

statsbox(ax, text[, x, y, alignment, ...])

valuebox_text(labels, values[, ...])

Create formatted text with two columns (labels, values)

Functions#

categorybox#

spellbook.plotutils.categorybox(ax, text, x=None, y=None, alignment='tl', text_args={})[source]#
Parameters
  • ax

  • text

  • x

  • y

  • alignment

  • text_args (dict) –

    Dictionary of keyword arguments that are passed on to matplotlib.axes.Axes.text().

    For example:

    • fontsize can be xx-small, x-small, small, medium, large, x-large or xx-large

get_data_kind#

spellbook.plotutils.get_data_kind(var)[source]#

Determine the datakind of a pandas.Series

The datakind can be

  • cat: categorical

  • ord: ordinal

  • cont: continuous

Parameters

var (pandas.Series) – The column of a pandas.DataFrame

Return type

str

legend_bbox_to_anchor#

spellbook.plotutils.legend_bbox_to_anchor(align='bl')[source]#

legend_loc#

spellbook.plotutils.legend_loc(align='bl')[source]#

not_yet_implemented#

spellbook.plotutils.not_yet_implemented(fig, grid, gridindex, message)[source]#

statsbox#

spellbook.plotutils.statsbox(ax, text, x=None, y=None, alignment='tr', fontsize='x-small', text_args={})[source]#

valuebox_text#

spellbook.plotutils.valuebox_text(labels, values, label_header=None, value_header=None)[source]#

Create formatted text with two columns (labels, values)

Parameters
  • labels (list[str]) – List of the variable names

  • values (list) – list of the values

  • label_header (str) – Header of the label column

  • value_header (str) – Header of the value column

Returns

The formatted text

Return type

str