pitchscapes.plotting.key_legend

pitchscapes.plotting.key_legend(ax=None, sharp_flat='sharp', location='top', circle_of_fifths=None, horizontal=None, x_scale=None, y_scale=None, aspect=1.0, x_offset=None, y_offset=None, palette=None, label_size=None, fontsize=None, axis_off=True, equal_axes_aspect=True)[source]
Parameters:
  • ax – axis to plot to or None to create

  • sharp_flat – one of [‘sharp’, ‘flat’]; whether to use sharps or flats as accidentals

  • location – one of [‘centre’, ‘top’, ‘bottom’, ‘left’, ‘right’, ‘top left’, ‘top right’, ‘left small’,

‘right small’]; set the default values of horizontal, label_size, fontsize, x_scale, y_scale, x_offset, y_offset (providing explicit values overwrites the defaults set by location); default is ‘centre’ resulting in values: horizontal = True label_size = 0.8 x_scale = 1. y_scale = 1. x_offset = 0.5 y_offset = 0.5 fontsize = 10 :type circle_of_fifths: :param circle_of_fifths: bool or None (default); whether to arrange keys chromatically (False) or along the circle of fifths (True); if None the value is determined from the default, which can be set via set_circle_of_fifths. :type horizontal: :param horizontal: orientation of the legend: horizontal (True) or vertical False :type x_scale: :param x_scale: scaling along x-direction (default: 1.) :type y_scale: :param y_scale: scaling along y-direction (default: 1.) :type aspect: :param aspect: aspect ratio (default: 1.); determines the aspect ratio (width/height) of the legend elements; if the x- and y-axes are not scalled equally, this can be used to retain circular legend elements :type x_offset: :param x_offset: change position in x-direction (default: 0.5) :type y_offset: :param y_offset: change position in y-direction (default: 0.5) :type palette: :param palette: palette argument used in get_key_colour :type label_size: :param label_size: scales the size of the legend elements (default: 0.8) :type fontsize: :param fontsize: fontsize of the legend elements’ text (default: 10) :type axis_off: :param axis_off: whether to turn off axis visibility (default: True) :type equal_axes_aspect: :param equal_axes_aspect: whether to set equal aspect ratio for the axes (default: True) :return: None (if ax was provided) or newly created figure and axis