conkit.plot.tools module

Internal utility functions

class ColorDefinitions[source]

Bases: object

A class storing all color definitions for the various plots for fast and easy handling

AA_ENCODING = {'A': '#882D17', 'C': '#F3C300', 'D': '#875692', 'E': '#F38400', 'F': '#A1CAF1', 'G': '#BE0032', 'H': '#C2B280', 'I': '#848482', 'K': '#008856', 'L': '#E68FAC', 'M': '#0067A5', 'N': '#F99379', 'P': '#604E97', 'Q': '#F6A600', 'R': '#B3446C', 'S': '#DCD300', 'T': '#8DB600', 'V': '#654522', 'W': '#E25822', 'X': '#000000', 'Y': '#2B3D26'}
FACTOR1 = '#B5DD2B'
GENERAL = '#000000'
L20CUTOFF = '#B5DD2B'
L5CUTOFF = '#3F4587'
MATCH = '#0F0B2C'
MISMATCH = '#DC4869'
PRECISION50 = '#3F4587'
STRUCTURAL = '#D8D6D6'
find_minima(data, order=1)[source]

Find the minima in a 1-D list

Parameters:
  • data (list, tuple) – A list of values
  • order (int, optional) – The order, i.e. number of points next to point to consider
Returns:

A list of indices for minima

Return type:

list

Warning

For multi-dimensional problems, see argrelmin().

Raises:
get_adjusted_aspect(ax, aspect_ratio)[source]

Adjust the aspect ratio

Parameters:
  • ax (Axes) – A Axes instance
  • aspect_ratio (float) – The desired aspect ratio for Axes
Returns:

The required aspect ratio to achieve the desired one

Return type:

float

Warning

This function only works for non-logarithmic axes.

get_points_on_circle(radius, h=0, k=0)[source]

Calculate points on a circle with even spacing

Parameters:
  • radius (int) – The radius of the circle
  • h (int, optional) – The x coordinate of the origin
  • k (int, optional) – The y coordinate of the origin
Returns:

The list of coordinates for each point

Return type:

list

get_radius_around_circle(p1, p2)[source]

Obtain the radius around a given circle

Parameters:
Returns:

The radius for points so p1 and p2 do not intersect

Return type:

float