예제 #1
0
def linear_regression_test():
    x = np.linspace(0, 1, 100)
    y = 2 * x + 3 + np.random.normal(0, 0.3, len(x))

    ax = plot.get_axis(preset='large')
    plot.linear_regression(x, y, ax=ax)

    ax = plot.get_axis(preset='medium')
    plot.linear_regression(x, y, regression=False, ax=ax)
예제 #2
0
def histogram_test():
    iris = sns.load_dataset('iris')
    ax = plot.get_axis(preset='wide')
    plot.histogram(iris.sepal_length,
                   bins=22,
                   xlabel='Sepal Length',
                   ylabel='Frequency',
                   ax=ax)
예제 #3
0
def line_test():
    fmri = sns.load_dataset('fmri')
    ax = plot.get_axis(preset='wide')
    plot.line(
        data=fmri,
        x='timepoint',
        y='signal',
    )
예제 #4
0
def frequency_sort_by_values_test():
    data = [np.random.choice(a=range(10)) for _ in range(100)]
    ax = plot.get_axis(preset='wide')
    plot.frequency(
        data=data,
        ax=ax,
        sort_by_values=True,
    )
예제 #5
0
def umap_test():
    iris = sns.load_dataset('iris')
    ax = plot.get_axis(preset='wide')
    plot.umap(
        iris[['sepal_length', 'sepal_width', 'petal_length', 'petal_width']],
        ax=ax,
        s=5,
        labels=iris['species']
    )
예제 #6
0
def dimensionality_reduction_test():
    iris = sns.load_dataset('iris')
    ax = plot.get_axis(figsize=(8.4 * 3, 8.4))
    plot.dimensionality_reduction(
        data=iris[['sepal_length', 'sepal_width', 'petal_length', 'petal_width']],
        labels=iris.species,
        ax=ax,
        xticklabels=False,
        yticklabels=False,
    )
예제 #7
0
def pca_with_no_xyticklabels_test():
    iris = sns.load_dataset('iris')
    ax = plot.get_axis(figsize=(8.4, 8.4))
    plot.pca(
        data=iris[['sepal_length', 'sepal_width', 'petal_length', 'petal_width']],
        labels=iris.species,
        s=5,
        ax=ax,
        xticklabels=False,
        yticklabels=False,
    )
예제 #8
0
def mutation_signature_test():
    data = Counter()
    c_contexts = [p + 'C' + n for (p, n) in itertools.product('ACGT', 'ACGT')]
    t_contexts = [p + 'T' + n for (p, n) in itertools.product('ACGT', 'ACGT')]
    c_alts, t_alts = 'AGT', 'ACG'

    for context, alt in itertools.product(c_contexts, c_alts):
        data[(context, alt)] = np.random.randint(1, 30)
    for context, alt in itertools.product(t_contexts, t_alts):
        data[(context, alt)] = np.random.randint(1, 30)

    ax = plot.get_axis(figsize=(20.4, 3.4))
    plot.mutation_signature(data, ax=ax)
    plot.set_suptitle('Mutational signatures.')
예제 #9
0
def boxplot_test():
    iris = sns.load_dataset('iris')
    ax = plot.get_axis(preset='wide', transpose=True)
    plot.boxplot(data=iris, x='species', y='sepal_length', ax=ax)
예제 #10
0
def frequency_test():
    data = [np.random.choice(a=range(10)) for _ in range(100)]
    ax = plot.get_axis(preset='wide')
    plot.frequency(data, ax=ax, xlabel='Your numbers', ylabel='Frequency')