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’, ‘E’: ‘#F38400’, ‘D’: ‘#875692’, ‘G’: ‘#BE0032’, ‘F’: ‘#A1CAF1’, ‘I’: ‘#848482’, ‘H’: ‘#C2B280’, ‘K’: ‘#008856’, ‘M’: ‘#0067A5’, ‘L’: ‘#E68FAC’, ‘N’: ‘#F99379’, ‘Q’: ‘#F6A600’, ‘P’: ‘#604E97’, ‘S’: ‘#DCD300’, ‘R’: ‘#B3446C’, ‘T’: ‘#8DB600’, ‘W’: ‘#E25822’, ‘V’: ‘#654522’, ‘Y’: ‘#2B3D26’, ‘X’: ‘#000000’}
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:

list

A list of indices for minima

Raises:

ValueError

Order needs to be >= 1!

ValueError

More than two elements required!

Warning

For multi-dimensional problems, see scipy.signal.argrelmin().

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:

float

The required aspect ratio to achieve the desired one

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:

list

The list of coordinates for each point

get_radius_around_circle(p1, p2)[source]

Obtain the radius around a given circle

Parameters:

p1 : list, tuple

Point 1

p2 : list, tuple

Point 2 adjacent p1

Returns:

float

The radius for points so p1 and p2 do not intersect

points_on_circle(*args, **kwargs)[source]