Example #1
0
from scipy.stats import stats

from Util import Globals, Parser
from Visualizations import TimeBoxplot
from StabilityMetrics import DeltaMetrics, UnavoidableMovement, ShneidermanWattenberg

technique_list = Parser.list_techniques(sibgrapi=True)


def plot_mean_boxplot(
        dataset_id,
        metrics='VIS'):  # Default case was what was used at VIS18 paper
    data = []
    for i, technique_id in enumerate(technique_list):
        print(Globals.acronyms[technique_id], end=' ', flush=True)
        technique_data = []
        history = Parser.parse_rectangles(technique_id, dataset_id)
        for revision in range(len(history) - 1):
            if metrics == 'VIS':
                delta_vis = DeltaMetrics.compute_delta_vis(
                    history[revision], history[revision + 1])
                delta_data = DeltaMetrics.compute_delta_data(
                    history[revision], history[revision + 1])
                un_mov = UnavoidableMovement.compute_unavoidable_movement(
                    history[revision], history[revision + 1])

                ratios = (1 - delta_vis) / (1 - delta_data)
                diffs = 1 - abs(delta_vis - delta_data)
                unavoidable = 1 - (delta_vis - un_mov)

                mean = (ratios + diffs + unavoidable) / 3
Example #2
0
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
from matplotlib.colors import Normalize
from matplotlib import cm

from StabilityMetrics import DeltaMetrics
from Util import Globals, Parser
from Visualizations import MatrixPlot

# Use this dummy technique list for now
# technique_list = ['SliceAndDice', 'SquarifiedTreeMap']
technique_list = Parser.list_techniques()


def scatter(dataset_id):
    fig, axs = plt.subplots(int(len(technique_list)/2), 2, sharex=True, sharey=True, figsize=(20, 44))

    xlim = 0
    for i, technique_id in enumerate(technique_list):
        # print(Globals.acronyms[technique_id])
        ax = fig.axes[i]

        history = Parser.parse_rectangles(technique_id, dataset_id)
        # Compute all delta_vis and delta_data values for a dataset (1 pair per cell)
        all_delta_data = np.array([])
        all_delta_vis = np.array([])
        for revision in range(len(history) - 1):