Skip to content

capwitf/My-MathModeling-skills / math-figure

math-figure

Unverified

Use when 高教社杯/CUMCM 数学建模论文需要规划、选择、审查或修复图、图表、表格转图、图注、图像证据行、正文放置、附录降级或图后结论。

FileKindSize
SKILL.mdskill md4.6 KB
agents/openai.yamlconfig312 B
assets/chart-templates/paper_style.pyscript8.9 KB
assets/high-impact-templates/chart-atlas/atlas-01-bar-charts.pngbinary122.4 KB
assets/high-impact-templates/chart-atlas/atlas-02-line-trends.pngbinary413.7 KB
assets/high-impact-templates/chart-atlas/atlas-03-heatmaps.pngbinary156.1 KB
assets/high-impact-templates/chart-atlas/atlas-04-scatter-bubble.pngbinary473.7 KB
assets/high-impact-templates/chart-atlas/atlas-05-radar-polar.pngbinary615.3 KB
assets/high-impact-templates/chart-atlas/atlas-06-distributions.pngbinary228.3 KB
assets/high-impact-templates/chart-atlas/atlas-07-forest-interval.pngbinary263.8 KB
assets/high-impact-templates/chart-atlas/atlas-08-area-stacked.pngbinary326.9 KB
assets/high-impact-templates/chart-atlas/atlas-09-image-plates.pngbinary350.6 KB
assets/high-impact-templates/chart-atlas/atlas-10-network-matrix.pngbinary304.8 KB
assets/high-impact-templates/figures4papers/assets/Dispersion_motivation.pngbinary818.0 KB
assets/high-impact-templates/figures4papers/assets/Dispersion_observation.pngbinary790.0 KB
assets/high-impact-templates/figures4papers/assets/Dispersion_observation_distillation.pngbinary602.2 KB
assets/high-impact-templates/figures4papers/assets/ImmunoStruct_contrastive.pngbinary490.4 KB
assets/high-impact-templates/figures4papers/assets/ImmunoStruct_results_CEDAR.pngbinary1.2 MB
assets/high-impact-templates/figures4papers/assets/ImmunoStruct_results_IEDB.pngbinary933.9 KB
assets/high-impact-templates/figures4papers/assets/ImmunoStruct_schematic.pngbinary950.1 KB
assets/high-impact-templates/figures4papers/assets/RNAGenScape_schematic.pngbinary976.9 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/figures/ablation.pngbinary347.0 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/figures/comparison.pngbinary794.0 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/figures/comparison_human.pngbinary860.2 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/figures/comparison_worm.pngbinary903.6 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/plot_ablation.pyscript2.9 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/plot_comparison.pyscript3.8 KB
assets/high-impact-templates/figures4papers/figure_CellSpliceNet/plot_comparison_cross_species.pyscript6.4 KB
assets/high-impact-templates/figures4papers/figure_Cflows/diffusion_swiss_roll.pyscript3.5 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.pngbinary1.7 MB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdfbinary24.2 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pngbinary280.7 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdfbinary19.3 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pngbinary379.2 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdfbinary18.8 KB
assets/high-impact-templates/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pngbinary321.2 KB
assets/high-impact-templates/figures4papers/figure_Cflows/plot_comparison_Ablation.pyscript2.4 KB
assets/high-impact-templates/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.pyscript3.0 KB
assets/high-impact-templates/figures4papers/figure_Cflows/plot_comparison_Trajectory.pyscript2.9 KB
assets/high-impact-templates/figures4papers/figure_Dispersion/figures/idea.pngbinary375.8 KB
assets/high-impact-templates/figures4papers/figure_Dispersion/figures/illustration.pngbinary745.1 KB
assets/high-impact-templates/figures4papers/figure_Dispersion/plot_idea.pyscript2.4 KB
assets/high-impact-templates/figures4papers/figure_Dispersion/plot_illustration.pyscript15.1 KB
assets/high-impact-templates/figures4papers/figure_FPGM/figures/freq_prior.pngbinary626.0 KB
assets/high-impact-templates/figures4papers/figure_FPGM/plot_freq_prior.pyscript6.4 KB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.pngbinary797.6 KB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.pngbinary1.1 MB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.pngbinary781.0 KB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.pngbinary739.8 KB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/plot_bars.pyscript7.5 KB
assets/high-impact-templates/figures4papers/figure_ImmunoStruct/raw_data.pyscript4.4 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/figures/manifold.pngbinary105.7 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/figures/manifold_holes.pngbinary996.0 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.pngbinary830.5 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.pngbinary90.2 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/figures/results_sweep.pngbinary138.8 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/plot_comparison.pyscript11.0 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/plot_hole_manifold.pyscript2.5 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/plot_manifold.pyscript1.8 KB
assets/high-impact-templates/figures4papers/figure_RNAGenScape/plot_sweep.pyscript2.8 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/figures/ablation_curves.pngbinary586.6 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/figures/comparison_posttraining.pngbinary243.4 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/figures/comparison_radar.pngbinary790.9 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/figures/concept.pngbinary1.6 MB
assets/high-impact-templates/figures4papers/figure_VIGIL/plot_ablation.pyscript5.9 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/plot_comparison_radar.pyscript7.2 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/plot_concept.pyscript9.0 KB
assets/high-impact-templates/figures4papers/figure_VIGIL/plot_posttraining.pyscript2.9 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/figures/brute_force.pngbinary1.7 MB
assets/high-impact-templates/figures4papers/figure_brainteaser/figures/correctness_by_category.pngbinary640.1 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.pngbinary1.0 MB
assets/high-impact-templates/figures4papers/figure_brainteaser/figures/rewriting.pngbinary400.5 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/figures/selfcorrection_math.pngbinary597.2 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/plot_brute_force.pyscript9.9 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/plot_correctness_by_category.pyscript6.3 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.pyscript6.4 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/plot_rewriting.pyscript3.6 KB
assets/high-impact-templates/figures4papers/figure_brainteaser/plot_selfcorrection_math.pyscript3.9 KB
assets/high-impact-templates/figures4papers/figure_ophthal_review/figures/composition_heatmap.pngbinary273.0 KB
assets/high-impact-templates/figures4papers/figure_ophthal_review/figures/trend_by_month.pngbinary355.6 KB
assets/high-impact-templates/figures4papers/figure_ophthal_review/plot_composition.pyscript3.0 KB
assets/high-impact-templates/figures4papers/figure_ophthal_review/plot_trend.pyscript5.4 KB
references/chart-template-index.mdmarkdown4.5 KB
references/contest-chart-selection.mdmarkdown2.5 KB
references/contest-figure-pitfalls.mdmarkdown2.0 KB
references/high-impact-chart-assets.mdmarkdown4.2 KB
references/paper-figure-style.mdmarkdown2.4 KB
references/selection-guide.mdmarkdown3.0 KB
references/visual-readiness-loop.mdmarkdown1.7 KB
scripts/check_contest_figure.pyscript3.0 KB
scripts/profile_result_table.pyscript3.8 KB

assets/high-impact-templates/figures4papers/figure_FPGM/plot_freq_prior.py

View on GitHub
import os
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.ticker import LinearLocator, FormatStrFormatter


def load_freq_prior_data(data_dir):
    datasets = {}
    for name in sorted(os.listdir(data_dir)):
        if not name.endswith(".npz"):
            continue
        path = os.path.join(data_dir, name)
        data = np.load(path)
        datasets[name] = {key: data[key] for key in data.files}
    return datasets


def plot_dataset(ax, title, sample1_arr, sample2_arr, max_freq_radius,
                 line_colors, line_styles, legend_labels):
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['left'].set_linewidth(2)
    ax.spines['bottom'].set_linewidth(2)
    ax.plot(np.arange(len(sample1_arr))[:max_freq_radius],
            sample1_arr[:max_freq_radius],
            color=line_colors[0], linestyle=line_styles[0], linewidth=2.5)
    ax.plot(np.arange(len(sample2_arr))[:max_freq_radius],
            sample2_arr[:max_freq_radius],
            color=line_colors[1], linestyle=line_styles[1], linewidth=2.5)
    ax.set_title(title, fontfamily='monospace')
    ax.set_xlabel('Frequency Radius')
    ax.set_xticks(np.arange(max_freq_radius)[::4])
    ax.set_ylabel('Mean Amplitude')
    ax.set_ylim(bottom=0)
    ax.yaxis.set_major_locator(LinearLocator(4))
    ax.yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
    ax.legend(legend_labels, frameon=False, fontsize=14)


if __name__ == "__main__":
    data_dir = os.path.join(os.path.dirname(__file__), "data")
    datasets = load_freq_prior_data(data_dir)

    plt.rcParams['font.family'] = 'helvetica'
    plt.rcParams['font.size'] = 16
    fig = plt.figure(figsize=(20, 7))
    gs = fig.add_gridspec(2, 5, width_ratios=[1, 1, 0, 1, 1])

    # Part 1. Plot the individual datasets.
    max_freq_radius = 17
    line_colors = ['#2A9D8F', '#E76F51']
    line_styles = ['-', '--']
    subplot_positions = [gs[0, 0], gs[0, 1], gs[1, 0], gs[1, 1]]

    per_dataset_names = ['Kvasir', 'CVC-ClinicDB', 'CVC-ColonDB', 'ETIS']
    max_name_len = max(len(name) for name in per_dataset_names)
    for dataset_idx, dataset_name in enumerate(per_dataset_names):
        data = datasets[dataset_name.lower() + '_freq_prior.npz']
        sample1_arr = data['data1']
        sample2_arr = data['data2']

        ax = fig.add_subplot(subplot_positions[dataset_idx])
        plot_dataset(ax, dataset_name, sample1_arr, sample2_arr,
                     max_freq_radius, line_colors, line_styles,
                     [r'Random subset 1 $(N=50)$', r'Random subset 2 $(N=50)$'])

    # Part 2. Plot the mixed dataset across two columns.
    data = datasets['mixed_freq_prior.npz']
    sample1_arr = data['data1']
    sample2_arr = data['data2']
    ax = fig.add_subplot(gs[0, 3:5])
    plot_dataset(ax, '', sample1_arr, sample2_arr, max_freq_radius, line_colors, line_styles,
                 [r'Random subset 1 $(N=500)$', r'Random subset 2 $(N=500)$'])
    ax.set_title('Mixuture of all four datasets', fontfamily='helvetica')

    # Part 3. Plot per-dataset mean/std curves in a single panel.
    ax = fig.add_subplot(gs[1, 3])
    per_dataset_colors = ['#4C72B0', '#C2A5CF', '#7B3294', '#8C564B']
    curve_means = []
    for dataset_idx, dataset_name in enumerate(['Kvasir', 'CVC-ClinicDB', 'CVC-ColonDB', 'ETIS']):
        data = datasets[dataset_name.lower() + '_freq_prior.npz']
        sample1_arr = data['data1'][:max_freq_radius]
        sample2_arr = data['data2'][:max_freq_radius]
        stacked = np.stack([sample1_arr, sample2_arr], axis=0)
        mean = stacked.mean(axis=0)
        std = stacked.std(axis=0)
        x_vals = np.arange(len(mean))
        color = per_dataset_colors[dataset_idx]
        padded_name = dataset_name.ljust(max_name_len)
        ax.plot(x_vals, mean, color=color, linewidth=1.5,
                label=f'{padded_name}' + r' $(N=100)$')
        ax.fill_between(x_vals, mean - std, mean + std, color=color, alpha=0.2)
        curve_means.append(mean)

    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['left'].set_linewidth(2)
    ax.spines['bottom'].set_linewidth(2)
    ax.axvline(2, color='0.6', linestyle='--', linewidth=1.2, label=r'Radius$=2$')
    x_left = ax.get_xlim()[0]
    for mean, color in zip(curve_means, per_dataset_colors):
        ax.hlines(mean[2], xmin=x_left, xmax=2, color=color, linestyle='--', linewidth=1.0)
    ax.set_xlabel('Frequency Radius')
    ax.set_xticks(np.arange(max_freq_radius)[::4])
    ax.set_xlim(left=x_left, right=max_freq_radius)
    ax.set_ylabel('Mean Amplitude')
    ax.set_ylim(bottom=0, top=3)
    ax.yaxis.set_major_locator(LinearLocator(4))
    ax.yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
    ax.legend(frameon=False, ncol=1, prop={'family': 'monospace', 'size': 12})

    # Part 4. Plot foreground/background curves in a single panel.
    data = datasets['foreground_background.npz']
    polyp_arr = data['data1'][:max_freq_radius]
    background_arr = data['data2'][:max_freq_radius]
    x_vals = np.arange(len(polyp_arr))
    polyp_color = '#1F3A93'
    background_color = '#16A085'

    ax = fig.add_subplot(gs[1, 4])
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['left'].set_linewidth(2)
    ax.spines['bottom'].set_linewidth(2)
    fb_names = ['Polyp', 'Background']
    fb_max_len = max(len(name) for name in fb_names)
    ax.plot(x_vals, polyp_arr, color=polyp_color, linewidth=2.5,
            label=f'{fb_names[0].ljust(fb_max_len)}' + r' $(N=500)$')
    ax.plot(x_vals, background_arr, color=background_color, linewidth=2.5,
            linestyle=':', label=f'{fb_names[1].ljust(fb_max_len)}' + r' $(N=500)$')
    ax.axvline(2, color='0.6', linestyle='--', linewidth=1.2, label=r'Radius$=2$')
    x_left = ax.get_xlim()[0]
    ax.hlines(polyp_arr[2], xmin=x_left, xmax=2, color=polyp_color, linestyle='--', linewidth=1.2)
    ax.hlines(background_arr[2], xmin=x_left, xmax=2, color=background_color, linestyle='--', linewidth=1.2)
    ax.set_xlabel('Frequency Radius')
    ax.set_xticks(np.arange(max_freq_radius)[::4])
    ax.set_xlim(left=x_left, right=max_freq_radius)
    ax.set_ylabel('Mean Amplitude')
    ax.set_ylim(bottom=0)
    ax.yaxis.set_major_locator(LinearLocator(4))
    ax.yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
    ax.legend(frameon=False, prop={'family': 'monospace', 'size': 12})

    fig.tight_layout(pad=1)
    os.makedirs('figures', exist_ok=True)
    fig.savefig('figures/freq_prior.png', dpi=300)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall