def plot_heatmap_logarithmic()

in src/graphing/heatmap.py [0:0]


def plot_heatmap_logarithmic(heatmap, dimensions, labels=True):

    width = dimensions[0]  # x_bucket_count
    height = dimensions[1]  # y_bucket_count
    max_pause_ms = height * dimensions[3]
    max_time_ms = width * dimensions[2]
    multipler = max_time_ms / width  # multipler is the size of a bucket for time direction

    # x labels are the time labels
    time_labels = [num * multipler for num in range(1, width + 1)]  # TODO : UPDATE TO BE FASTER

    time_labels_temp = []
    for i in range(len(time_labels)):
        if not i % 2:
            time_labels_temp.append(str(round(time_labels[i], 2)) + " s")
        else:
            time_labels_temp.append("")

    # time_labels = [str(round(label, 2)) + " s" for label in time_labels]
    time_labels = time_labels_temp

    # y labels are ms pause time labels
    base = dimensions[3]
    latency_labels = [str(round(math.pow(base, idx), 4)) for idx in range(height)]
    latency_labels.reverse()
    
    latency_labels = list(dimensions[4])
    
    latency_labels.reverse()
    latency_labels = [str(round(label, 4)) for label in latency_labels]
    # latency_labels = [round((num * multipler) + min_pause_ms, 2) for num in reversed(range(1, height + 1))]
    # latency_labels = [str(label) + " ms" for label in latency_labels]
    ## Create a figure, and add data to heatmap. Plot then show heatmap.
    fig, ax = plt.subplots()
    ax.set_title("Latency during runtime.")
    im = __heatmap_make(heatmap, latency_labels, time_labels, ax=ax, cmap="plasma", cbarlabel="Frequency")
    if labels:
        __annotate_heatmap(im, valfmt="{x}")
    fig.tight_layout()
    return ax