diff --git a/ChartMimic/dataset/ori_500/3d_10.png b/ChartMimic/dataset/ori_500/3d_10.png deleted file mode 100644 index d67a29a599e7ac4d1ce35ceff24939095382fd8b..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/3d_10.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/area_1.py b/ChartMimic/dataset/ori_500/area_1.py deleted file mode 100644 index 0531ed42370bdaf35fd32bdf4b3ef3060f20a499..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/area_1.py +++ /dev/null @@ -1,116 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -x = [1, 2, 3, 4, 5] -y1 = [18, 24, 27, 29, 29.5] -y2 = [12, 17, 21, 23, 24] -y3 = [6, 10, 12, 14, 15] -y4 = [5, 6, 7, 8, 8.5] - -# Labels for legend -label_activity_net_mIoU = "ActivityNet mIoU" -label_breakfast_mof = "Breakfast MoF" -label_activity_net_cider = "ActivityNet CIDEr" -label_qvhighlights_map = "QVHighlights mAP" - -# Plot limits -xlim_values = (1, 5) -ylim_values = (0, 35) - -# Axis labels -xlabel_values = ["10K", "50K", "1M", "5M", "10M"] -ylabel_values = [0, 10, 20, 30, 34] - -# Axis ticks -xticks_values = x -yticks_values = [0, 10, 20, 30, 34] - -# Horizontal line value -axhline_value = 30 - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the data -plt.figure(figsize=(9, 8)) # Adjusting figure size to match original image dimensions -plt.plot( - x, - y1, - "o-", - clip_on=False, - zorder=10, - markerfacecolor="#eec7bb", - markeredgecolor="#d77659", - markersize=12, - color="#d77659", - label=label_activity_net_mIoU, -) -plt.plot( - x, - y2, - "o-", - clip_on=False, - zorder=10, - markerfacecolor="#f5dbc3", - markeredgecolor="#e8a66c", - markersize=12, - color="#e8a66c", - label=label_breakfast_mof, -) -plt.plot( - x, - y3, - "o-", - clip_on=False, - zorder=10, - markerfacecolor="#b4d7d1", - markeredgecolor="#509b8d", - markersize=12, - color="#509b8d", - label=label_activity_net_cider, -) -plt.plot( - x, - y4, - "o-", - clip_on=False, - zorder=10, - markerfacecolor="#abb5ba", - markeredgecolor="#2e4552", - markersize=12, - color="#2e4552", - label=label_qvhighlights_map, -) - -# Filling the area under the curves -plt.fill_between(x, y1, y2, color="#eec7bb", alpha=1) -plt.fill_between(x, y2, y3, color="#f5dbc3", alpha=1) -plt.fill_between(x, y3, y4, color="#b4d7d1", alpha=1) -plt.fill_between(x, y4, color="#abb5ba", alpha=1) - -# Adding a horizontal dashed line at y=axhline_value -plt.axhline(axhline_value, color="black", linestyle="dotted") - -# Setting the x-axis、y-axis limits -plt.xlim(*xlim_values) -plt.ylim(*ylim_values) - -# Setting the x-axis tick labels -plt.xticks(xticks_values, xlabel_values) -plt.yticks(yticks_values, ylabel_values) - -# Adding a legend -plt.legend(loc="lower center", ncol=4, bbox_to_anchor=(0.5, -0.1), frameon=False) -plt.gca().tick_params(axis="both", which="both", length=0) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("area_1.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/area_4.py b/ChartMimic/dataset/ori_500/area_4.py deleted file mode 100644 index cf90b72ee701e59c0fe1ba81371183772b8a1b47..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/area_4.py +++ /dev/null @@ -1,102 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -# Data -n_aug = ["0", "0.125", "0.25", "0.5", "1", "2", "4", "8"] -content = np.array([1, 3, 6, 4, 2, 1, 0.5, 0.2]) -organization = np.array([0.5, 1, 1.5, 2, 1.5, 1, 0.5, 0.25]) -language = np.array([0, 0.5, 1, 2, 4, 3, 2, 1]) - -# Calculate cumulative values for stacked area chart -cumulative_content = content -cumulative_organization = cumulative_content + organization -cumulative_language = cumulative_organization + language - -# Positions for the bars on the x-axis -ind = np.arange(len(n_aug)) - -# Variables for plot configuration -content_label = "Content" -organization_label = "Organization" -language_label = "Language" -xlim_values = (0, 7) -ylim_values = (0, 10) -xlabel_text = "n" -ylabel_text = "Performance Gain (%)" -title_text = "Cumulative Performance Gain by Augmentation Level" -yticks_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -legend_location = "upper center" -legend_fontsize = 12 -legend_frameon = False -legend_shadow = True -legend_facecolor = "#ffffff" -legend_ncol = 3 -legend_bbox_to_anchor = (0.5, 1.2) - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plot -fig, ax = plt.subplots(figsize=(8, 4)) # Adjusted for better aspect ratio -ax.fill_between( - n_aug, 0, cumulative_content, label=content_label, color="#0173b2", alpha=0.7 -) -ax.fill_between( - n_aug, - cumulative_content, - cumulative_organization, - label=organization_label, - color="#de8f05", - alpha=0.7, -) -ax.fill_between( - n_aug, - cumulative_organization, - cumulative_language, - label=language_label, - color="#20a983", - alpha=0.7, -) - -# Enhancing the plot with additional visuals -ax.spines["top"].set_visible(False) -ax.spines["right"].set_visible(False) -ax.spines["left"].set_visible(False) -ax.spines["bottom"].set_visible(False) -ax.set_yticks(yticks_values) -# Setting the x-axis and y-axis limits dynamically -ax.set_ylim(*ylim_values) # Ensure all data fits well -ax.set_xlim(*xlim_values) -# Labels, Title and Grid -ax.set_xlabel(xlabel_text, fontsize=14) -ax.set_ylabel(ylabel_text, fontsize=14) -ax.set_title(title_text, fontsize=16, y=1.2) -ax.tick_params(axis="both", which="both", color="gray") -# Custom legend -ax.legend( - loc=legend_location, - fontsize=legend_fontsize, - frameon=legend_frameon, - shadow=legend_shadow, - facecolor=legend_facecolor, - ncol=legend_ncol, - bbox_to_anchor=legend_bbox_to_anchor, -) - -# Grid -ax.grid(True, linestyle="--", alpha=0.5, which="both") - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to reduce white space -plt.tight_layout() -plt.savefig("area_4.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/area_5.py b/ChartMimic/dataset/ori_500/area_5.py deleted file mode 100644 index 6b2bb7bf9f146d32698984eb0964f4fe012e59bb..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/area_5.py +++ /dev/null @@ -1,65 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -year = [1950, 1960, 1970, 1980, 1990, 2000, 2010, 2018] -population_by_continent = { - "africa": [228, 284, 365, 477, 631, 814, 1044, 1275], - "americas": [943, 606, 540, 727, 840, 425, 519, 619], - "asia": [1394, 1686, 2120, 1625, 1202, 1714, 2169, 2560], - "europe": [220, 253, 276, 295, 310, 303, 294, 293], - "oceania": [200, 300, 340, 360, 280, 260, 320, 280], -} - -# Extracted variables -legend_labels = list(population_by_continent.keys()) -xlim_values = (1950, 2018) -ylim_values = (0, 6000) -xlabel_value = "Year" -ylabel_value = "Number of people (millions)" -title_value = "World population" -legend_loc = "upper center" -legend_reverse = False -legend_frameon = False -legend_ncol = 5 -legend_bbox_to_anchor = (0.5, 1.08) -title_y_position = 1.08 -colors = ["#b2e7aa", "#fae18f", "#d75949", "#f0906d", "#a1a8d6"] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig, ax = plt.subplots(figsize=(8, 6)) -ax.stackplot( - year, - population_by_continent.values(), - labels=legend_labels, - alpha=0.8, - colors=colors, -) -ax.legend( - loc=legend_loc, - reverse=legend_reverse, - frameon=legend_frameon, - ncol=legend_ncol, - bbox_to_anchor=legend_bbox_to_anchor, -) -ax.set_xlim(*xlim_values) -ax.set_ylim(*ylim_values) -ax.set_title(title_value, y=title_y_position) -ax.set_xlabel(xlabel_value) -ax.set_ylabel(ylabel_value) -ax.tick_params(axis="both", which="both", length=0) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("area_5.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_48.png b/ChartMimic/dataset/ori_500/bar_48.png deleted file mode 100644 index 5f87e706b696956937477e4888f9738c16d60252..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_48.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_51.py b/ChartMimic/dataset/ori_500/bar_51.py deleted file mode 100644 index b978cb10a867a4283980dad98751c8e869a8f4ce..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_51.py +++ /dev/null @@ -1,50 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data -professions = [ - "Farmer", - "Scooter mechanic", - "Household management", - "Construction/Renovation", - "Gardening", - "Making Bricks", - "Carpenter", - "Baker", - "Crafting/knitting", - "Cleaning / laundry", -] -number_of_videos = [2008, 2060, 2158, 2343, 2548, 2915, 3216, 3543, 4190, 5375] - -# Axes Limits and Labels -xlabel_value = "Number of Videos" -title = "Number of Videos by Profession" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create horizontal bar chart -plt.figure(figsize=(12, 8)) # Adjust figure size to match original image's dimensions -plt.barh(professions, number_of_videos, color="#685bc6") # Change bar color to purple -plt.xlabel(xlabel_value) -plt.title(title) - -# Add data labels -for index, value in enumerate(number_of_videos): - plt.text( - value + 50, index, str(value), va="center", fontsize=10 - ) # Adjust text position and font size - -plt.yticks(rotation=45) - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig("bar_51.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_6.py b/ChartMimic/dataset/ori_500/bar_6.py deleted file mode 100644 index 875499c8d8c713356c41689c5e6b7e480c156052..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_6.py +++ /dev/null @@ -1,74 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Emotion labels -emotions = [ - "Amusement", - "Unbothered", - "Sadness", - "Pride", - "Nervousness", - "Annoyance", - "Gratitude", - "Relief", - "Joy", - "Disapproval", - "Excitement", - "Delight", - "Oblivious", - "Embarrassment", - "Disappointment", -] - -# Approximate frequency values based on the image -frequencies = [ - 2.1, - 2.7, - 3.0, - 3.5, - 3.5, - 3.8, - 4.0, - 4.0, - 6.0, - 6.0, - 6.0, - 6.6, - 6.7, - 7.0, - 7.6, -] - -xlabel = "Frequency (%)" -ylabel = "Emotion" -xticks = list(range(0, 9)) -xlim = [0, 8.5] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create horizontal bar chart -plt.figure(figsize=(8, 8)) # Adjust figure size -plt.barh(emotions, frequencies, color="#84ade3") - -# Set x-axis limits -plt.xlim(xlim) - -# Set x-axis ticks -plt.xticks(xticks) - -# Set labels and title -plt.xlabel(xlabel) -plt.ylabel(ylabel) - -# =================== -# Part 4: Saving Output -# =================== -# Show the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig("bar_6.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_60.png b/ChartMimic/dataset/ori_500/bar_60.png deleted file mode 100644 index 0825ffb95c6cb51874aa8e16f83d5cd3b21f7a64..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_60.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_61.png b/ChartMimic/dataset/ori_500/bar_61.png deleted file mode 100644 index 14e782733621ac80738c03fe2b1e8ca092162a88..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_61.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_63.png b/ChartMimic/dataset/ori_500/bar_63.png deleted file mode 100644 index a7da6f40a53a5e4840b33d8fb5440f8c6439d804..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_63.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_64.png b/ChartMimic/dataset/ori_500/bar_64.png deleted file mode 100644 index 1911d0ce0b2f314bc8fa1c1ca26c3cf32839c88d..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_64.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_65.png b/ChartMimic/dataset/ori_500/bar_65.png deleted file mode 100644 index 0a59bc44a091cfd58ddf92116f46a0adf2cb9d6d..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_65.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_65.py b/ChartMimic/dataset/ori_500/bar_65.py deleted file mode 100644 index e103fb1ef63250e36d8a81c86866900e59177b8a..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_65.py +++ /dev/null @@ -1,128 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import numpy as np - -np.random.seed(0) - -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Define the categories and scores -categories = ["LLAMA-Default", "LLAMA-HAG", "Vicuna-Default", "Vicuna-HAG"] -num_scores = 4 -score_range = (-3.5, -0.5) -scores_3 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist() -scores_5 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist() -scores_7 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist() -scores_10 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist() - -# The x locations for the groups -ind = np.arange(len(scores_3)) - -# The width of the bars -bar_width = 0.2 - -# Labels and Plot Types -label_3_Constraint_Words = "3 Constraint Words" -label_5_Constraint_Words = "5 Constraint Words" -label_7_Constraint_Words = "7 Constraint Words" -label_10_Constraint_Words = "10 Constraint Words" - -# Axes Limits and Labels -xlabel_value = "Score" -ax_title = "Scores by group and constraint word count" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the figure and axes objects -fig, ax = plt.subplots(figsize=(10, 6)) - -# Plotting data -bars_3 = ax.barh( - ind - bar_width * 1.5, - scores_3, - bar_width, - label=label_3_Constraint_Words, - color="salmon", -) -bars_5 = ax.barh( - ind - bar_width * 0.5, - scores_5, - bar_width, - label=label_5_Constraint_Words, - color="skyblue", -) -bars_7 = ax.barh( - ind + bar_width * 0.5, - scores_7, - bar_width, - label=label_7_Constraint_Words, - color="coral", -) -bars_10 = ax.barh( - ind + bar_width * 1.5, - scores_10, - bar_width, - label=label_10_Constraint_Words, - color="lightblue", -) - -# Adding text inside the bars -for i, (score_3, score_5, score_7, score_10) in enumerate( - zip(scores_3, scores_5, scores_7, scores_10) -): - ax.text( - score_3, - i - bar_width * 1.5, - f"{score_3:.1f}", - va="center", - ha="right", - color="black", - ) - ax.text( - score_5, - i - bar_width * 0.5, - f"{score_5:.1f}", - va="center", - ha="right", - color="black", - ) - ax.text( - score_7, - i + bar_width * 0.5, - f"{score_7:.1f}", - va="center", - ha="right", - color="black", - ) - ax.text( - score_10, - i + bar_width * 1.5, - f"{score_10:.1f}", - va="center", - ha="right", - color="black", - ) - -# Adding labels, title, and custom x-axis tick labels, etc. -ax.set_xlabel(xlabel_value) -ax.set_title(ax_title) -ax.set_yticks(ind) -ax.set_yticklabels(categories) -ax.legend() - -# Invert y-axis to have the first entry at the top -plt.gca().invert_yaxis() - -# Show grid lines for x-axis -ax.xaxis.grid(True) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("bar_65.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_67.png b/ChartMimic/dataset/ori_500/bar_67.png deleted file mode 100644 index 0e8f32a3739012008ef813c63fbfaeea4b3c4213..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_67.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_72.png b/ChartMimic/dataset/ori_500/bar_72.png deleted file mode 100644 index a21e7857577fed00b84a692f3ad581ee7c1cfb9c..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_72.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_73.png b/ChartMimic/dataset/ori_500/bar_73.png deleted file mode 100644 index 53fa081c6aaf19380ede37573c8b08ad9700308e..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_73.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_76.png b/ChartMimic/dataset/ori_500/bar_76.png deleted file mode 100644 index 7087342353f4b225eb950ad8985195cc614cf542..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_76.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_77.png b/ChartMimic/dataset/ori_500/bar_77.png deleted file mode 100644 index e6d9f8e9c11b179f9973046f0ba6c87bb8243e76..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_77.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_89.png b/ChartMimic/dataset/ori_500/bar_89.png deleted file mode 100644 index 7eb7deb0820c033b8cd4d207d38ba5e24303fc75..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_89.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_89.py b/ChartMimic/dataset/ori_500/bar_89.py deleted file mode 100644 index a329b4d5a44e89e5071477e44068329d6c48a1ae..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_89.py +++ /dev/null @@ -1,53 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for the bar chart -superfamilies = range(1, 11) -accuracies = [0.9, 0.83, 0.86, 0.84, 0.7, 0.85, 0.93, 0.89, 0.88, 1.0] -accuracies2 = [0.3, 0.5, 0.8, 0.6, 0.4, 0.65, 0.43, 0.69, 0.58, 1.0] -accuracies3 = [0.7, 0.6, 0.5, 0.7, 0.7, 0.64, 0.76, 0.56, 0.38, 1.0] -xlabel = "Top-10 superfamilies in training dataset" -ylabel1 = "Accuracy" -ylabel2 = "Recall" -ylabel3 = "Precision" -ylim = [0.0, 1.1] -yticks = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0] -yline = 0.6 - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the bar chart -fig, axes = plt.subplots( - 3, 1, figsize=(10, 6), sharex=True -) # Adjusting figure size to match the original image's dimensions -axes[0].bar(superfamilies, accuracies, color="#7fa9cc") -axes[1].bar(superfamilies, accuracies2, color="#e39c90") -axes[2].bar(superfamilies, accuracies3, color="#af86ce") - -# Add a horizontal line for the average accuracy -axes[0].axhline(y=yline, color="red", linestyle="--") - -# Add labels and title -plt.xlabel(xlabel) -axes[0].set_ylabel(ylabel1) -axes[1].set_ylabel(ylabel2) -axes[2].set_ylabel(ylabel3) - -# Set y-axis limits -plt.ylim(0.0, 1.1) -# Set x-axis, y-axis ticks -plt.xticks(superfamilies) -plt.yticks([0.0, 0.2, 0.4, 0.6, 0.8, 1.0]) - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig("bar_89.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_98.png b/ChartMimic/dataset/ori_500/bar_98.png deleted file mode 100644 index 3727697708f0bd69bc46c177eb8e2c0395830b4d..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_98.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_98.py b/ChartMimic/dataset/ori_500/bar_98.py deleted file mode 100644 index 0cde016f233c1cd098f0238e857976e7129453f2..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_98.py +++ /dev/null @@ -1,91 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data -labels = [ - "Model A", - "Model B", - "Model C", - "Model D", - "Model E", - "Model F", - "Model G", - "Model H", - "Model I", -] -non_aggregation = np.random.rand(9) * 100 -aggregation = np.random.rand(9) * 100 - -datalabels = ["Contrastive Search", "Beam Search"] -ylabel = "Scores" -title = "Performance Comparison by Model" -ylim = [0, 120] - -x = np.arange(len(labels)) # the label locations -width = 0.35 # the width of the bars - -legendtitle = "Methods" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting -fig, ax = plt.subplots(figsize=(10, 6)) # Adjust the size accordingly -rects1 = ax.bar( - x - width / 2, - non_aggregation, - width, - label="Contrastive Search", - color="#69b3a2", - hatch="/", -) -rects2 = ax.bar( - x + width / 2, aggregation, width, label="Beam Search", color="#d98763", hatch="\\" -) - -# Add some text for labels, title and custom x-axis tick labels, etc. -ax.set_ylabel(ylabel) -ax.set_title(title) -ax.set_xticks(x) -ax.set_xticklabels(labels, rotation=0) -ax.set_ylim(ylim) -ax.set_xlim(-1, len(labels)) - -# Adding the values on top of the bars -for rect in rects1 + rects2: - height = rect.get_height() - ax.annotate( - f"{height:.1f}", - xy=(rect.get_x() + rect.get_width() / 2, height), - xytext=(0, 3), # 3 points vertical offset - textcoords="offset points", - ha="center", - va="bottom", - ) - -# Custom grid -ax.grid(axis="y", color="gray", linestyle="--", linewidth=0.7, alpha=0.7) -ax.set_axisbelow(True) - -# Hide the ticks -ax.tick_params(axis="both", which="both", length=0) - -# Hide the right and top spines -ax.spines["right"].set_visible(False) -ax.spines["top"].set_visible(False) -ax.legend(title=legendtitle) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("bar_98.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/bar_99.png b/ChartMimic/dataset/ori_500/bar_99.png deleted file mode 100644 index e2a8c323645a5ca8a6e01bba5bc54fbb269353fc..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/bar_99.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/bar_99.py b/ChartMimic/dataset/ori_500/bar_99.py deleted file mode 100644 index e6c220b9a37537ed323d7b90e0884b952e7fa5a8..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/bar_99.py +++ /dev/null @@ -1,68 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Create traffic data -data = np.array( - [ - [150, 180, 75, 90, 80], # Traffic flow (in thousands of vehicles per day) - [2.5, 2.0, 1.5, 2.0, 2.8], # Accident rate (accidents per 100,000 vehicles) - [60, 55, 70, 65, 72], # Public transport usage (% of population) - [80, 75, 90, 85, 88], # Road conditions (road quality index out of 100) - [85, 80, 75, 90, 88], # Public satisfaction (satisfaction score out of 100) - ] -) -categories = [ - "Traffic Flow", - "Accident Rate", - "Public Transport Usage", - "Road Conditions", - "Public Satisfaction", -] - -titles = ["Dataset 1", "Dataset 2", "Dataset 3", "Dataset 4"] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig, axs = plt.subplots(2, 2, figsize=(10, 8)) # Creating a 2x2 grid of subplots - -colors = plt.get_cmap("Pastel2")(np.linspace(0.15, 0.85, data.shape[0])) -bar_width = 0.5 # Width of the bars - - -# Function to plot a bar chart in a specific subplot -def plot_bars(ax, data, categories, color, title): - bars = ax.bar(np.arange(len(categories)), data, color=color, width=bar_width) - ax.set_title(title) - ax.set_xticks(np.arange(len(categories))) - ax.set_xticklabels(categories, rotation=45) - for bar in bars: - yval = bar.get_height() - ax.text( - bar.get_x() + bar.get_width() / 2.0, - yval, - round(yval, 1), - va="top", - ha="center", - ) # Annotate bars - - -# Plot data on each subplot -for i, ax in enumerate(axs.flat): - plot_bars(ax, data[i], categories, colors[i], titles[i]) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout to prevent overlap -fig.tight_layout() -plt.savefig("bar_99.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/box_13.py b/ChartMimic/dataset/ori_500/box_13.py deleted file mode 100644 index 13a64f45f5635e7a99f7966d47ebf909006a6c33..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/box_13.py +++ /dev/null @@ -1,64 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data to mimic the boxplot in the picture -data = [ - np.random.normal(0.825, 0.02, 100), - np.random.normal(0.850, 0.03, 100), - np.random.normal(0.840, 0.025, 100), - np.random.normal(0.860, 0.015, 100), - np.random.normal(0.855, 0.02, 100), -] - -labels = ["SQL-Only", "PoT", "IC-LP", "DAIL", "IC-LP+PoT"] -ylabel = "Execution Accuracy" -ylim = [0.725, 0.925] -yticks = np.arange(0.750, 0.901, 0.025) - - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the boxplot -fig, ax = plt.subplots( - figsize=(6, 5) -) # Adjusting figure size as per the dimensions provided -bp = ax.boxplot( - data, - labels=labels, - patch_artist=True, - boxprops=dict(facecolor="#549e9a", color="black"), - medianprops=dict(color="black"), - whiskerprops=dict(color="black", linestyle="-"), - capprops=dict(color="black", linestyle="-"), -) - -# Remove outliers -for flier in bp["fliers"]: - flier.set(marker="", color="black") - -# Set the y-axis range and tick labels -ax.set_ylim(ylim) -ax.set_yticks(yticks) -# Set the y-axis label -ax.set_ylabel(ylabel, fontsize=12) - -# Set the tick label size -ax.tick_params(axis="both", which="major", labelsize=10) -plt.xticks(rotation=45) - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig("box_13.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/box_21.png b/ChartMimic/dataset/ori_500/box_21.png deleted file mode 100644 index ea5ea754591d0ad8b94b7ee122ff8d4f6e99cd7e..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/box_21.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/errorbar_19.py b/ChartMimic/dataset/ori_500/errorbar_19.py deleted file mode 100644 index 6934712687fbf947f1d5ad5e287f5c62c808bd07..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorbar_19.py +++ /dev/null @@ -1,76 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data representing social statistics for three different cities -categories = ["Detroit", "Philadelphia", "Baltimore"] -metrics = [ - "Crime Rate", - "Happiness Index", - "Social Security Coverage", - "Political Participation", -] -performance = np.array( - [ - [50, 70, 90, 80], - [60, 80, 85, 75], - [40, 75, 95, 85], - ] -) -errors = np.array( - [ - [5, 6, 9, 6], - [6, 7, 8, 7], - [8, 9, 6, 8], - ] -) -ylim = [30, 100] -ylabel = "Percentage" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Figure size to match a 3x1 subplot layout -fig, axes = plt.subplots(3, 1, figsize=(10, 9), sharex=True) -# Colors, choosing a different palette to differentiate the plots -colors = ["#8e44ad", "#3498db", "#e74c3c", "#f1c40f"] - -# Plotting bars -for i, ax in enumerate(axes): - for j, metric in enumerate(metrics): - ax.bar( - j, - performance[i, j], - width=0.8, - color=colors[j], - yerr=errors[i, j], - capsize=0, - label=metric if i == 0 else "", - ) - - # Setting x-axis labels, y-axis limits, and titles - ax.set_xticks(range(len(metrics))) - ax.set_xticklabels(metrics, rotation=45) - ax.set_ylim(ylim) - ax.set_xlabel(f"({chr(97+i)}) {categories[i]}") - ax.set_ylabel(ylabel) - ax.yaxis.grid(True) - ax.set_axisbelow(True) - -# Adding a legend outside of the plot on top -fig.legend(loc="upper center", bbox_to_anchor=(0.5, 1.05), ncol=len(metrics)) - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to prevent overlap and ensure labels are visible -plt.tight_layout() -plt.savefig("errorbar_19.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorbar_28.py b/ChartMimic/dataset/ori_500/errorbar_28.py deleted file mode 100644 index ca2020988fa200fedc274861577c4539b0ea4182..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorbar_28.py +++ /dev/null @@ -1,82 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - -import matplotlib.colors as mcolors - -# =================== -# Part 2: Data Preparation -# =================== -# Data for environmental factors affecting plant growth -categories = [ - "Sunlight", - "Water Quality", - "Soil pH", - "Fertilizer", - "Temperature", - "Pesticides", - "CO2 Levels", - "Plant Variety", - "Planting Density", - "Watering Frequency", -] -values = [0.18, 0.15, 0.12, 0.09, 0.06, 0.03, -0.06, -0.03, -0.02, -0.03] -errors = [0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01] - -min_val = min(values) - 0.1 -max_val = max(values) + 0.1 - - -# Normalizing function to convert values to a 0-1 range for color scaling -def normalize(value, min_val, max_val): - return (value - min_val) / (max_val - min_val) - - -# Determine color based on normalized value -def get_color(value): - norm_value = normalize(value, min_val, max_val) - green_base = np.array(mcolors.to_rgb("#6a8347")) - # Create a color that ranges from very light green to the base green - return mcolors.to_hex((1 - green_base) * (1 - norm_value) + green_base) - - -colors = [get_color(value) for value in values] - -# Axes Limits and Labels -ylabel_value = "Environmental Factors" -xlabel_value = "Impact on Plant Growth (Δ to control)" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create figure and axis -fig, ax = plt.subplots(figsize=(10, 8)) - -# Horizontal bar chart -bars = ax.barh( - categories, values, xerr=errors, color=colors, capsize=3, edgecolor="none" -) -ax.set_ylabel(ylabel_value) -ax.set_xlabel(xlabel_value) - -# Set y-axis limits and x-axis limits -ax.set_xlim(min_val, max_val) # Adjust limits to encompass errors - -# Remove top and right spines for a cleaner look -ax.spines["top"].set_visible(False) -ax.spines["right"].set_visible(False) - -# Customize grid lines -ax.xaxis.grid(True, linestyle="--", which="major", color="gray", alpha=0.6) -ax.set_axisbelow(True) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout to prevent clipping of ylabel -plt.tight_layout() -plt.savefig("errorbar_28.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorbar_29.py b/ChartMimic/dataset/ori_500/errorbar_29.py deleted file mode 100644 index 2422970da67645d51e29eeb881f9639143c84424..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorbar_29.py +++ /dev/null @@ -1,83 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Updated Urban Transportation Data for three major cities -metrics = ["Traffic Volume", "Public Transit", "Accident Rate"] -values = np.array( - [ - [220, 180, 220], # New York - [150, 120, 130], # Los Angeles - [130, 160, 110], # Chicago - ] -) - -# Updated asymmetric error values, now more proportionate to the data scale -errors = np.array( - [ - [[25, 20], [15, 15], [25, 20]], # Errors for New York (lower, upper) - [[20, 15], [10, 15], [20, 10]], # Errors for Los Angeles - [[15, 20], [15, 10], [15, 15]], # Errors for Chicago - ] -) - -# Creating subplots for each city -cities = ["New York", "Los Angeles", "Chicago"] - -ylabel = "Metric Values" -ylim = [80, 280] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig, axs = plt.subplots(1, 3, figsize=(10, 4)) # Compact and square figure layout - - -# Function to plot each city's data -def plot_city_data(ax, errors, city_index, city_name): - x = np.arange(len(metrics)) # the label locations - bar_colors = ["#6a8347", "#377eb8", "#d62728"] - barerrors = np.array(errors).T[:, :, city_index] - bars = ax.bar(x, values[city_index], yerr=barerrors, color=bar_colors, capsize=5) - for bar, lower_error, upper_error in zip(bars, barerrors[0], barerrors[1]): - # Position for lower error text - ax.text( - bar.get_x() + bar.get_width() / 2, - bar.get_height() - lower_error - 15, - f"-{lower_error}", - va="bottom", - ha="center", - color="black", - ) - # Position for upper error text - ax.text( - bar.get_x() + bar.get_width() / 2, - bar.get_height() + upper_error + 3, - f"+{upper_error}", - ha="center", - color="black", - ) - - ax.set_title(city_name) - ax.set_xticks(x) - ax.set_xticklabels(metrics, rotation=90) - ax.set_ylabel(ylabel) - ax.set_ylim(ylim) # Uniform scale for all charts - - -for i, city in enumerate(cities): - plot_city_data(axs[i], errors, i, city) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("errorbar_29.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorbar_8.py b/ChartMimic/dataset/ori_500/errorbar_8.py deleted file mode 100644 index c524c418a591347e9f48955d3343328cc879fe44..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorbar_8.py +++ /dev/null @@ -1,88 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data (estimated from the image) -models = [ - "BERT", - "RoBERTa", - "DistilBERT", - "XLNet", - "Electra", - "Albert", - "BART", - "DeBERTa", - "Llama2", -] -ground_truth_accuracy = [50, 55, 60, 65, 40, 30, 70, 45, 35] -weak_labels_accuracy = [45, 50, 55, 60, 35, 25, 65, 40, 30] -error = [10, 8, 12, 10, 5, 7, 8, 10, 5] -labels = ["Ground-truth labels", "Weak labels"] -ylabel = "Accuracy (%)" -ylim = [0, 80] -yticks = np.arange(0, 71, 10) - - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig = plt.subplots(figsize=(10, 3)) -# Bar width -bar_width = 0.35 - -# X position of bars -r1 = np.arange(len(ground_truth_accuracy)) -r2 = [x + bar_width for x in r1] - -# Create bars -plt.bar( - r1, - ground_truth_accuracy, - color="#d47e6d", - width=bar_width, - label=labels[0], - yerr=error, - capsize=7, -) -plt.bar( - r2, - weak_labels_accuracy, - color="#76a4c5", - width=bar_width, - label=labels[1], - yerr=error, - capsize=7, -) - -# Add xticks on the middle of the group bars -plt.xticks([r + bar_width / 2 for r in range(len(ground_truth_accuracy))], models) - -# Create legend & Show graphic -plt.ylabel(ylabel) -plt.legend(frameon=False, loc="upper right") # Remove legend background - -# Set background color and grid -plt.gca().set_facecolor("#e5e5e5") -plt.grid(color="white", linestyle="-", linewidth=0.25, axis="both") -plt.gca().set_axisbelow(True) - -# Set y-axis limits -plt.ylim(ylim) -plt.yticks(yticks) - -for spine in plt.gca().spines.values(): - spine.set_visible(False) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("errorbar_8.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorbar_9.py b/ChartMimic/dataset/ori_500/errorbar_9.py deleted file mode 100644 index bce53cc9302d6e688521bb00b8df9da91d98114f..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorbar_9.py +++ /dev/null @@ -1,64 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Categories and values (estimated from the image) -categories = [ - "Syntax: Tagging, Chunking and Parsing", - "Discourse and Pragmatics", - "Information Extraction", - "Machine Learning for NLP", - "Information Retrieval and Text Mining", - "Phonology, Morphology and Word Segmentation", - "Computational Social Science and Social Media", -][::-1] -values = [-3.20, -3.1, -3.00, -2.90, -2.80, -2.70, -2.60][::-1] -error = [0.1, 0.15, 0.3, 0.25, 0.2, 0.1, 0.05] -xlabel = "A" -ylabel = "Categories" -title = "Your Chart Title Here" -xlim = [-3.5, -1.5] -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create horizontal bar chart -fig, ax = plt.subplots(figsize=(8, 8)) # Adjust figure size -bars = ax.barh( - categories, - values, - color="#c5b3d6", - edgecolor="white", - height=0.5, - xerr=error, - capsize=0, -) - -# Set labels and title (if any) -ax.set_xlabel(xlabel) -ax.set_ylabel(ylabel) -ax.set_title(title) - -# Invert y-axis to match the image -ax.invert_yaxis() - -# Set x-axis range to match the reference image -ax.set_xlim(xlim) - -# Remove grid lines -ax.xaxis.grid(False) -ax.spines["top"].set_visible(False) -ax.spines["right"].set_visible(False) - -# Set background color to white -ax.set_facecolor("white") - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig("errorbar_9.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorpoint_1.py b/ChartMimic/dataset/ori_500/errorpoint_1.py deleted file mode 100644 index eb8ac275dce29ee320d6bf79d5140c7416464e8f..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorpoint_1.py +++ /dev/null @@ -1,66 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data (replace with actual data) -categories = [ - "Kashmir", - "Religion", - "Crime and Justice", - "CAA", - "Pulwama-Balakot", - "Politics", -] -means = np.random.uniform(0.05, 0.15, len(categories)) -std_devs = np.random.uniform(0.01, 0.05, len(categories)) -dataset_mean = np.mean(means) - -# Labels and Plot Types -label_Mean = "Mean" -label_Dataset_mean = "Dataset mean" - -# Axes Limits and Labels -ylabel_value = "Shouting Fraction (Fraction of videos)" -ylim_values = [0.01, 0.18] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create figure and axis -fig, ax = plt.subplots(figsize=(8, 5)) - -# Error bar plot -ax.errorbar( - categories, - means, - yerr=std_devs, - fmt="o", - color="blue", - ecolor="blue", - capsize=5, - label=label_Mean, -) - -# Dataset mean line -ax.axhline(y=dataset_mean, color="grey", linestyle="--", label=label_Dataset_mean) - -# Customizing the plot -ax.set_ylabel(ylabel_value) -ax.set_xticklabels(categories, rotation=45, ha="right") -ax.legend() -ax.set_ylim(ylim_values) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout to prevent clipping of tick-labels -plt.tight_layout() -plt.savefig("errorpoint_1.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorpoint_4.py b/ChartMimic/dataset/ori_500/errorpoint_4.py deleted file mode 100644 index ac9e0c56b665af12b3bda83a8ee31a21ee8681da..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorpoint_4.py +++ /dev/null @@ -1,72 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data (example values, replace with actual data) -categories = [ - "Education", - "Religion", - "Bollywood", - "Crime and Justice", - "Farmers Protest", - "Issue Politics", -] -unique_speaker_mean = [10, 12, 11, 13, 14, 15] # Replace with actual mean values -unique_shouter_mean = [5, 6, 7, 6, 5, 4] # Replace with actual mean values -unique_speaker_error = [1, 1.5, 1, 1.5, 2, 1.5] # Replace with actual error values -unique_shouter_error = [ - 0.5, - 0.75, - 0.5, - 0.75, - 1, - 0.75, -] # Replace with actual error values -labels = ["Unique speaker count mean", "Unique shouter count mean"] -ylabel = "Number of speakers" -axlabel = "Dataset unique shouter count mean" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting -fig, ax = plt.subplots( - figsize=(10, 6) -) # Adjust the size to match the original image's dimensions -ax.errorbar( - categories, - unique_speaker_mean, - yerr=unique_speaker_error, - fmt="o", - color="blue", - label=labels[0], -) -ax.errorbar( - categories, - unique_shouter_mean, - yerr=unique_shouter_error, - fmt="o", - color="red", - label=labels[1], -) - -# Customization -ax.set_ylabel(ylabel) -ax.set_xticklabels(categories, rotation=45, ha="right") -ax.axhline( - y=sum(unique_shouter_mean) / len(unique_shouter_mean), - color="grey", - linestyle="--", - label=axlabel, -) -ax.legend() - -# =================== -# Part 4: Saving Output -# =================== -# Show plot -plt.tight_layout() -plt.savefig("errorpoint_4.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorpoint_5.py b/ChartMimic/dataset/ori_500/errorpoint_5.py deleted file mode 100644 index d7701a526ba731c5c0e4aed758a6ca15a735b245..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/errorpoint_5.py +++ /dev/null @@ -1,77 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -categories = [ - "KASHMIR", - "COVID/LOCKDOWN", - "SPORTS", - "CHINA", - "PULWAMA-BALAKOT", -] # Capitalized category labels -means = [0.22, 0.23, 0.18, 0.12, 0.05] -errors = [0.03, 0.02, 0.05, 0.06, 0.02] -downerrors = [0.01, 0.02, 0.03, 0.04, 0.05] -legendtitles = ["Dataset mean", "Mean"] -texttitle = "Dataset mean" -ylabel = "Female Face presence (Fraction of videos)" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the data -fig, ax = plt.subplots( - figsize=(8, 6) -) # Adjusting figure size to match original image dimensions -ax.errorbar( - categories, - means, - yerr=[errors, downerrors], - fmt="o", - color="blue", - ecolor="blue", - capsize=5, -) - -# Adding a legend with both "Mean" and "Dataset mean" -dataset_mean = 0.253 -mean_line = ax.errorbar( - [], [], yerr=[], fmt="o", color="blue", ecolor="blue", capsize=5 -) -dataset_mean_line = ax.axhline( - y=dataset_mean, color="gray", linestyle="--", linewidth=1 -) -ax.legend( - [dataset_mean_line, mean_line], - legendtitles, - loc="upper right", - fancybox=True, - framealpha=1, - shadow=True, - borderpad=1, -) -# Adding a horizontal line for dataset mean and text annotation with a white background -ax.text( - 0.95, - dataset_mean, - texttitle, - va="center", - ha="right", - backgroundcolor="white", - transform=ax.get_yaxis_transform(), -) -# Setting labels -ax.set_ylabel(ylabel) -ax.set_title("") -plt.xticks(rotation=30) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("errorpoint_5.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/errorpoint_9.png b/ChartMimic/dataset/ori_500/errorpoint_9.png deleted file mode 100644 index 5c5fa5e84f8a8f43e80512551e84d085da06f14d..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/errorpoint_9.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/graph_2.py b/ChartMimic/dataset/ori_500/graph_2.py deleted file mode 100644 index 4789866cff90c4dde12c78c0f4401bae9bec3174..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/graph_2.py +++ /dev/null @@ -1,50 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import networkx as nx -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Create a random graph -G = nx.random_geometric_graph(30, 0.3) - -# Position the nodes based on their connections using a different layout algorithm -pos = nx.kamada_kawai_layout( - G -) # This layout algorithm may produce a more spread-out layout - -# Randomly select some edges to color blue -edges = list(G.edges()) -blue_edges = np.random.choice( - len(edges), size=int(len(edges) * 0.3), replace=False -) # 30% of the edges -blue_edges = [edges[i] for i in blue_edges] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig = plt.subplots(figsize=(8, 8)) - -# Draw the nodes -nx.draw_networkx_nodes(G, pos, node_size=200, node_color="pink") - -# Draw the edges -nx.draw_networkx_edges(G, pos, alpha=0.3) - -# Draw the selected edges in blue -nx.draw_networkx_edges(G, pos, edgelist=blue_edges, edge_color="#d0e2e8") - -# Remove axis -plt.axis("off") - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig("graph_2.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/graph_3.py b/ChartMimic/dataset/ori_500/graph_3.py deleted file mode 100644 index fd496773cf4d3f8223675f88582c895c74016028..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/graph_3.py +++ /dev/null @@ -1,35 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import networkx as nx - -# =================== -# Part 2: Data Preparation -# =================== -# Create a cycle graph with 12 nodes -G = nx.cycle_graph(12) -weights = {edge: i + 1 for i, edge in enumerate(G.edges())} -nx.set_edge_attributes(G, weights, "weight") - -pos = nx.spring_layout(G, iterations=200) - -labels = {i: str(i) for i in range(12)} - -# Draw edge labels -edge_labels = nx.get_edge_attributes(G, "weight") - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -plt.figure(figsize=(10, 8)) -nx.draw(G, pos, node_size=800, node_color="gold") -nx.draw_networkx_labels(G, pos, labels=labels) -nx.draw_networkx_edge_labels(G, pos, edge_labels=edge_labels) - -# =================== -# Part 4: Saving Output -# =================== -# Show the plot -plt.tight_layout() -plt.savefig("graph_3.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/hist_15.py b/ChartMimic/dataset/ori_500/hist_15.py deleted file mode 100644 index 07d5e2c7974cad2d2b3269e4ffa4b20f19f4dd64..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/hist_15.py +++ /dev/null @@ -1,57 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Generate normally distributed data -data = np.random.normal(loc=2.0, scale=1.0, size=10000) - -# Axes Limits and Labels -title = "Histogram of Wind Speed Measurements" -xlabel_value = "Wind Speed (km/h)" -ylabel_value = "Number of Measurements" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Set the figure size -plt.figure(figsize=(8, 6)) - -# Enable the grid -plt.grid(True, linestyle="--", linewidth=0.5, alpha=0.7) - -# Histogram of the data -n, bins, patches = plt.hist(data, bins=25, color="skyblue", edgecolor="blue", alpha=0.7) - -# Highlight the median of the data -median = np.median(data) -plt.axvline(median, color="purple", linestyle="dashed", linewidth=2) - -# Adjust the median text position to not overlap the bars when possible -median_text_position = max(n) * 0.9 -for bin_edge, count in zip(bins, n): - if bin_edge > median and count < median_text_position: - # Place the text above the median position - median_text_position = count - break -plt.text(median + 0.5, median_text_position, f"Median: {median:.2f}", color="purple") - -# Title and labels relevant to database statistics -plt.title(title) -plt.xlabel(xlabel_value) -plt.ylabel(ylabel_value) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust the layout -plt.tight_layout() - -plt.savefig("hist_15.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/hist_4.py b/ChartMimic/dataset/ori_500/hist_4.py deleted file mode 100644 index 87ed09ee1f775b6c13684866e492db9faaa9f92f..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/hist_4.py +++ /dev/null @@ -1,91 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data (replace with actual data) -center_data = np.random.normal(6, 2, 1000) -random_data = np.random.normal(1, 2, 1000) - -# Define bins aligned for both histograms -bins = np.histogram(np.hstack((center_data, random_data)), bins=30)[1] -labels = ["Center", "Random"] -xlabel = "Distance Difference (Random vs. Center)" -ylabel = "Number of Examples" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create figure and axis -fig, ax = plt.subplots( - figsize=(5, 3) -) # Adjusted to match the original image's dimensions - -# Calculate the histogram data for each set and plot them -ax.hist( - center_data, - bins=bins, - color="#f2a965", - edgecolor="#fdf460", - linewidth=1.2, - label=labels[0], - align="mid", - histtype="stepfilled", - alpha=0.7, -) -ax.hist( - random_data, - bins=bins, - color="#709dc6", - edgecolor="#ca3531", - linewidth=1.2, - label=labels[1], - align="mid", - histtype="stepfilled", - alpha=0.7, -) - -# To show the overlapping areas, we plot the two histograms with transparency -ax.hist( - center_data, - bins=bins, - color="#f2a965", - edgecolor="#fdf460", - linewidth=1.2, - alpha=0.7, - align="mid", - histtype="stepfilled", -) -ax.hist( - random_data, - bins=bins, - color="#709dc6", - edgecolor="#ca3531", - linewidth=1.2, - alpha=0.7, - align="mid", - histtype="stepfilled", -) - -# Set labels -ax.set_xlabel(xlabel) -ax.set_ylabel(ylabel) - -# Add legend -ax.legend() - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout -plt.tight_layout() - -# Save the plot -plt.savefig("hist_4.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/hist_5.py b/ChartMimic/dataset/ori_500/hist_5.py deleted file mode 100644 index 5177694dba5b183cdd40484386b941aa74f1cc0a..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/hist_5.py +++ /dev/null @@ -1,53 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data to approximate the distribution in the image -data = np.random.gamma(shape=2.0, scale=1.0, size=10000) -data = data[data < 30] # Limiting the data to match the x-axis in the image -xlabel = "Number of Repetition" -ylabel = "Number of Clusters" -binslist = [30, 30] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Set the figure size to match the original image's dimensions -plt.figure(figsize=(4, 3)) - -# Show grid with some transparency -plt.grid(True, linestyle="-", linewidth=0.5, color="#000000", alpha=0.1) - -# Create the histogram -plt.hist(data, bins=binslist[0], color="#dca684") - -# Create the histogram with histtype='step' for edge-only bars -plt.hist( - data, - bins=binslist[1], - color="#dca684", - edgecolor="#d1885c", - histtype="step", - linewidth=1.2, -) - -# Set the title and labels to match the image -plt.xlabel(xlabel) -plt.ylabel(ylabel) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout -plt.tight_layout() - -# Display the plot -plt.savefig("hist_5.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/line_12.py b/ChartMimic/dataset/ori_500/line_12.py deleted file mode 100644 index d9c1ba3ba388e8168a1f6f60da5aa2030c2c8924..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_12.py +++ /dev/null @@ -1,103 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -sample_ratio = [0.25, 0.50, 0.75, 1.00] -std_acc_512 = [0.07, 0.06, 0.01, 0.05] -std_acc_1024 = [0.055, 0.045, 0.04, 0.035] -std_acc_2048 = [0.03, 0.025, 0.02, 0.015] - -# Extracted variables -line_label_512 = "MAXN=512" -line_label_1024 = "MAXN=1024" -line_label_2048 = "MAXN=2048" -xlim_values = (0.25, 1) -ylim_values = (0.00, 0.08) -xlabel_value = "Sample Ratio" -ylabel_value = "Std of ACC" -xticks_values = sample_ratio -yticks_values = None # Not explicitly set in the code -xtickslabel_fontsize = 14 -ytickslabel_fontsize = 14 -title_value = None # Not explicitly set in the code -axhline_value = None # Not explicitly set in the code -axvline_value = None # Not explicitly set in the code - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the lines with increased marker size and line width -plt.figure(figsize=(8, 6)) -plt.plot( - sample_ratio, - std_acc_512, - marker="*", - markersize=10, - linewidth=2, - color="#2ab34a", - label=line_label_512, - clip_on=False, - zorder=10, -) -plt.plot( - sample_ratio, - std_acc_1024, - marker="^", - markerfacecolor="white", - markersize=10, - linewidth=2, - markeredgecolor="#ee756e", - color="#ee756e", - clip_on=False, - zorder=10, - label=line_label_1024, -) -plt.plot( - sample_ratio, - std_acc_2048, - marker="o", - markerfacecolor="white", - markersize=10, - linewidth=2, - markeredgecolor="#4995c6", - color="#4995c6", - clip_on=False, - zorder=10, - label=line_label_2048, -) - -# Setting the x-axis and y-axis limits -plt.ylim(*ylim_values) # Set y-axis to go from 0 to 7 -plt.yticks(fontsize=ytickslabel_fontsize) -plt.xlim(*xlim_values) # Set y-axis to go from 0 to 7 -# Set x-axis to show only the values in the sample_ratio list -plt.xticks(xticks_values, fontsize=xtickslabel_fontsize) - -# Adding labels and title -plt.xlabel(xlabel_value, fontsize=18) -plt.ylabel(ylabel_value, fontsize=18) - -# Adding legend with increased font size -plt.legend( - fontsize="large", - loc="upper center", - ncol=3, - frameon=False, - bbox_to_anchor=(0.5, 1.1), -) - -# Adding grid -plt.grid(True, alpha=0.6) - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to reduce white space -plt.tight_layout() -plt.savefig('line_12.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_18.py b/ChartMimic/dataset/ori_500/line_18.py deleted file mode 100644 index 2c92d85dd921cdaf2e0fbda64c9f10dd7e6545fa..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_18.py +++ /dev/null @@ -1,105 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data -iterations = np.array([0, 250, 500, 750, 1000, 1250, 1500, 1750, 2000]) -gpt4_7b = np.array([0.1, 0.4, 0.7, 0.85, 0.9, 0.92, 0.93, 0.94, 0.95]) -gpt4_7b_ft = np.array([0.05, 0.2, 0.35, 0.5, 0.6, 0.65, 0.7, 0.72, 0.73]) -llama_7b = np.array([0.1, 0.45, 0.75, 0.88, 0.9, 0.91, 0.92, 0.93, 0.94]) -llama_7b_ft = np.array([0.05, 0.25, 0.4, 0.55, 0.65, 0.7, 0.75, 0.77, 0.78]) - -# Axes Limits and Labels -xlabel_value = "Iterations" -ylabel_value = "Attack Success Rate" - -# Labels -label_1 = "7B" -label_2 = "7B (Fine-tuned)" - -# Titles -title_1 = "GPT-4 Evaluation" -title_2 = "Llama Guard Evaluation" - - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Set the figure size to match the original image's dimensions -plt.figure(figsize=(9, 4)) - -# First subplot -plt.subplot(1, 2, 1) -plt.plot( - iterations, - gpt4_7b, - marker="o", - color="#0a6ae1", - label=label_1, - markerfacecolor="#0a6ae1", - linewidth=2, - markersize=5, -) -plt.plot( - iterations, - gpt4_7b_ft, - marker="o", - color="#d75faa", - label=label_2, - markerfacecolor="#d75faa", - linewidth=2, - markersize=5, -) -plt.fill_between(iterations, gpt4_7b - 0.05, gpt4_7b + 0.05, color="#0a6ae1", alpha=0.2) -plt.fill_between( - iterations, gpt4_7b_ft - 0.03, gpt4_7b_ft + 0.03, color="#d75faa", alpha=0.2 -) -plt.title(title_1, fontsize=14) -plt.xlabel(xlabel_value, fontsize=12) -plt.ylabel(ylabel_value, fontsize=12) - -# Second subplot -plt.subplot(1, 2, 2) -plt.plot( - iterations, - llama_7b, - marker="o", - color="#0a6ae1", - label=label_1, - markerfacecolor="#0a6ae1", - linewidth=2, - markersize=5, -) -plt.plot( - iterations, - llama_7b_ft, - marker="o", - color="#d75faa", - label=label_2, - markerfacecolor="#d75faa", - linewidth=2, - markersize=5, -) -plt.fill_between( - iterations, llama_7b - 0.05, llama_7b + 0.05, color="#0a6ae1", alpha=0.2 -) -plt.fill_between( - iterations, llama_7b_ft - 0.03, llama_7b_ft + 0.03, color="#d75faa", alpha=0.2 -) -plt.title(title_2, fontsize=14) -plt.xlabel(xlabel_value, fontsize=12) -plt.ylabel(ylabel_value, fontsize=12) -plt.legend(loc="lower right", frameon=True, bbox_to_anchor=(1, 0.1)) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and save plot -plt.tight_layout() -plt.savefig('line_18.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_19.py b/ChartMimic/dataset/ori_500/line_19.py deleted file mode 100644 index a9cad1270bfab6cf8a844eccc4d63a1255a28525..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_19.py +++ /dev/null @@ -1,64 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -fraction_of_training_data = np.array([0.01, 0.1, 1]) -full_accuracy = np.array([60, 70, 80]) -spt_accuracy = np.array([55, 65, 78]) -vpt_accuracy = np.array([42, 53, 65]) - -# Axes Limits and Labels -xlabel_value = "fraction of training data (log scale)" -xlim_values = [5, 25] - -ylabel_value = "test accuracy (%)" -ylim_values = [38, 84] -yticks_values = np.arange(40, 82, 10) - -# Labels -label_Full = "Full" -label_SPT = "SPT" -label_VPT = "VPT" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the data -plt.figure(figsize=(5, 4)) # Adjusting figure size to match original image dimensions -plt.plot(fraction_of_training_data, full_accuracy, "o-", color="green", label=label_Full) -plt.plot(fraction_of_training_data, spt_accuracy, "o-", color="red", label=label_SPT) -plt.plot(fraction_of_training_data, vpt_accuracy, "o-", color="blue", label=label_VPT) - -# Set y-axis to only display specific ticks and extend y-axis to leave space at top -plt.yticks(yticks_values, fontsize=16) -plt.ylim(ylim_values) # Adjusted y-axis limit - -# Set x-axis fontsize -plt.xticks(fontsize=16) - -# Setting the x-axis to log scale -plt.xscale("log") - -# Adding labels and title -plt.xlabel(xlabel_value, fontsize=16) -plt.ylabel(ylabel_value, fontsize=16) - -# Adding grid -plt.grid(True, which="both", ls="-", linewidth=0.8) - -# Adding legend, show it horizontally and place it at the lower right corner -plt.legend(loc="lower right", fontsize=12, ncol=3, columnspacing=0.5, edgecolor="black") - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to add more space on the right -plt.tight_layout() -plt.savefig('line_19.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_26.py b/ChartMimic/dataset/ori_500/line_26.py deleted file mode 100644 index 959bf839ea35304b020895f5298c79bd4fc918cc..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_26.py +++ /dev/null @@ -1,100 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - -from matplotlib.ticker import MultipleLocator - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -vocab_sizes = ["256", "512", "1024", "2048", "4096", "8192", "16384"] -bpe_values = [0.4, 0.8, 0.9, 0.95, 0.95, 0.95, 0.95] -wordpunct_values = [0.3, 0.6, 0.8, 0.85, 0.9, 0.9, 0.9] -whitespace_values = [0.5, 0.65, 0.7, 0.75, 0.7, 0.65, 0.6] - -# Variables for plot configuration -line_labels = ["BPE", "Wordpunct", "Whitespace"] -xlim_values = (0, len(vocab_sizes) - 1) -ylim_values = (0.2, 1.0) -xlabel_value = "Vocabulary Size" -ylabel_value = None -xticks_values = range(len(vocab_sizes)) -yticks_values = np.arange(0.2, 1.1, 0.2) -xtickslabel_values = vocab_sizes -ytickslabel_values = None -title_value = "Test set TPR | FPR = $10^{-4}$" -axhline_value = None -axvline_value = None - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the lines -plt.figure(figsize=(8, 6)) -plt.plot( - vocab_sizes, - bpe_values, - "o--", - clip_on=False, - zorder=10, - color="#0c5da5", - label=line_labels[0], -) -plt.plot( - vocab_sizes, - wordpunct_values, - "o--", - clip_on=False, - zorder=10, - color="#ff9500", - label=line_labels[1], -) -plt.plot( - vocab_sizes, - whitespace_values, - "o--", - clip_on=False, - zorder=10, - color="#00b945", - label=line_labels[2], -) - -# Setting x and y ticks -plt.xticks(xticks_values, xtickslabel_values, fontsize=14) -plt.xlim(xlim_values) -plt.yticks(yticks_values, fontsize=14) - -# Adding minor y-axis ticks with a step of 0.05 -ax = plt.gca() -# ax.yaxis.set_minor_locator(MultipleLocator(0.05)) - -# Adjust tick parameters -ax.tick_params(axis="both", which="both", length=5, color="gray") # Move ticks inside -ax.tick_params( - axis="y", which="minor", length=2 -) # Ensure minor ticks are visible but smaller - -# Title and labels -plt.title(title_value, fontsize=14) -plt.xlabel(xlabel_value, fontsize=14) - -# Enable gridlines for minor ticks -plt.grid(True, color="#b0b0b0", which="major", linestyle="-", linewidth=0.5) - -# Legend with serif font family -plt.legend( - frameon=False, fontsize=12, loc="lower center", bbox_to_anchor=(0.5, -0.2), ncol=3 -) - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to add more space on the right -plt.tight_layout() - -plt.savefig('line_26.pdf', bbox_inches='tight') - diff --git a/ChartMimic/dataset/ori_500/line_28.py b/ChartMimic/dataset/ori_500/line_28.py deleted file mode 100644 index a103d35c9cfaa710c2fffb6dd87279b44bab2b82..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_28.py +++ /dev/null @@ -1,70 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data -x = [0, 25, 50, 75, 100, 125, 150, 175, 200] -pilote_y = [0.85, 0.88, 0.90, 0.92, 0.93, 0.94, 0.80, 0.75, 0.70] -retrained_y = [0.78, 0.80, 0.83, 0.85, 0.87, 0.88, 0.89, 0.90, 0.91] -pretrained_accuracy = 0.75 - -# Axes Limits and Labels -xlabel_value = "Number of exemplars in class 'Run'" -xlim_values = [-10, 215] -xticks_values = np.arange(25, 201, 25) - -ylabel_value = "avg. accuracy of five rounds" -ylim_values = [0, 100] -yticks_values = np.arange(0.60, 1.00, 0.05) - -# Labels -label_1 = "PILOTE" -label_2 = "Re-trained model" -label_3 = "Pre-trained model accuracy" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plot -fig, ax = plt.subplots( - figsize=(6, 4) -) # Adjusting figure size to match original image dimensions - -# Line charts -ax.plot(x, pilote_y, marker="s", color="#d62728", label=label_1) -ax.plot( - x, retrained_y, marker="p", color="#1f77b4", label=label_2, markersize=8 -) - -# Set x,y-axis to only display specific ticks and extend y-axis to leave space at top -plt.yticks(yticks_values, fontsize=12) -plt.xticks(xticks_values, fontsize=12) -plt.xlim(xlim_values) # Adjusted y-axis limit - -# Horizontal dashed line -ax.axhline( - y=pretrained_accuracy, - color="green", - linestyle="-.", - label=label_3, -) - -# Legend -ax.legend(loc="lower right") - -# Labels -ax.set_xlabel(xlabel_value) -ax.set_ylabel(ylabel_value) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and show plot -plt.tight_layout() -plt.savefig('line_28.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_29.py b/ChartMimic/dataset/ori_500/line_29.py deleted file mode 100644 index cbdf86c20638e515dacedee083ff6a8d9528353b..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_29.py +++ /dev/null @@ -1,70 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -xllm_steps = range(1, 21) -xLLM_fidelity = [ - 0.1, - 0.125, - 0.15, - 0.1625, - 0.175, - 0.1875, - 0.2, - 0.2125, - 0.225, - 0.2375, - 0.25, - 0.25625, - 0.2625, - 0.26875, - 0.275, - 0.275, - 0.275, - 0.275, - 0.275, - 0.275, -] -single_steps = [0, 21] -single_pass_fidelity = [0.1] * len(single_steps) - -# Axes Limits and Labels -xlabel_value = "# of Steps" -xlim_values = [0, 21] -xticks_values = [0, 5, 10, 15, 20] - -ylabel_value = "Avg. Fidelity" -ylim_values = [0, 100] - -# Labels -label_1 = "xLLM" -label_2 = "Single-Pass LLM" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the lines -plt.figure(figsize=(4, 3)) -plt.plot(xllm_steps, xLLM_fidelity, "o-.", label=label_1, color="#8280cd") -plt.plot(single_steps, single_pass_fidelity, "-", label=label_2, color="red") - -# Adding legend -plt.legend() - -# Labeling axes -plt.xlabel(xlabel_value) -plt.ylabel(ylabel_value) -plt.xlim(xlim_values) -plt.xticks(xticks_values) - -# =================== -# Part 4: Saving Output -# =================== -# Display the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig('line_29.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_38.py b/ChartMimic/dataset/ori_500/line_38.py deleted file mode 100644 index 48775eff5d6448e7ef72acfaa35c72a02a9108e7..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_38.py +++ /dev/null @@ -1,67 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data -epochs = ["3", "10", "30", "100"] # Treat epochs as strings to make them categorical -gpt_neo = [0.8, 0.8, 0.8, 0.8] -model_3 = [0.7, 0.65, 0.6, 0.75] -model_5 = [0.65, 0.75, 0.35, 0.5] -model_7 = [0.6, 0.65, 0.5, 0.65] -model_10 = [0.45, 0.5, 0.45, 0.4] -model_30 = [0.3, 0.45, 0.75, 0.35] - -# Axes Limits and Labels -xlabel_value = "# Epochs" - -ylabel_value = "MA" -ylim_values = [0.0, 0.83] -yticks_values = np.arange(0.0, 0.81, 0.2) - -# Labels -label_GPT_Neo="GPT-Neo" -label_3 = "3" -label_5 = "5" -label_7 = "7" -label_10 = "10" -label_30 = "30" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plot -plt.figure(figsize=(6, 3)) -plt.axhline(y=0.8, color="black", linestyle="--", linewidth=1, label=label_GPT_Neo) -plt.plot(epochs, model_3, "r-", marker="s", label=label_3) -plt.plot(epochs, model_5, "y-", marker="s", label=label_5) -plt.plot(epochs, model_7, "k-", marker="s", label=label_7) -plt.plot(epochs, model_10, "b-", marker="s", label=label_10) -plt.plot(epochs, model_30, "g-", marker="s", label=label_30) - -plt.yticks(yticks_values, fontsize=14) -plt.ylim(ylim_values) - -# Set x-axis labels equidistantly -ax = plt.gca() -ax.set_xticks(np.arange(len(epochs))) # Positional indexing for equidistant spacing -ax.set_xticklabels(epochs, fontsize=14) # Labeling x-ticks as per epochs - -plt.xlabel(xlabel_value, fontsize=16) -plt.ylabel(ylabel_value, fontsize=16) - -plt.legend( - loc="lower left", ncol=3, fontsize=12, columnspacing=5 -) # Adjusted legend settings - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and show plot -plt.tight_layout() -plt.savefig('line_38.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_40.png b/ChartMimic/dataset/ori_500/line_40.png deleted file mode 100644 index a43338b3e6776d4f44de7847f8a24e496d87541c..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_40.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_41.png b/ChartMimic/dataset/ori_500/line_41.png deleted file mode 100644 index b51d5c12ca0c0ead1f90042191f9b53fb388400a..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_41.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_42.png b/ChartMimic/dataset/ori_500/line_42.png deleted file mode 100644 index b4352eb5c019fdd979cc4dc1454b0437577c22a7..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_42.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_43.png b/ChartMimic/dataset/ori_500/line_43.png deleted file mode 100644 index 59628c70c461489925385f14227f90ca4dd5c93b..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_43.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_43.py b/ChartMimic/dataset/ori_500/line_43.py deleted file mode 100644 index 7d150da45c15ee0ce91a5c541d39e93412ad0921..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_43.py +++ /dev/null @@ -1,109 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Simulated data -collab_x = np.array( - ["All", "MLP", "GCN", "NCN", "NCNC", "NeoGNN-BUDDY", "SEAL", "Node2Vec"] -) -collab_y = np.array([75, 73, 72, 70, 69, 71, 73, 74]) -collab_err = np.array([2, 3, 1, 1, 2, 2, 3, 2]) -collab_y2 = np.array( - [67, 65, 64, 62, 61, 63, 65, 66] -) # Adjusted data for clear spacing -collab_err2 = np.array([3, 3, 1, 2, 2, 3, 3, 4]) - -ppa_x = np.array( - ["All", "MLP", "GCN", "NCN", "NCNC", "NeoGNN-BUDDY", "SEAL", "Node2Vec"] -) -ppa_y = np.array([65, 63, 62, 60, 59, 61, 63, 64]) -ppa_err = np.array([3, 2, 1, 2, 3, 2, 2, 1]) -ppa_y2 = np.array([70, 69, 69, 68, 67, 69, 70, 68]) # Adjusted data for clear spacing -ppa_err2 = np.array([2, 3, 1, 1, 2, 2, 3, 2]) - -# Axes Limits and Labels -ylabel_value = "Hits@50" -ylim_values = [55, 80] -yticks_values = np.arange(55, 81, 5) - -# Labels -label_1 = "ogbl-collab 2022" -label_2 = "ogbl-collab 2023" -label_3 = "ogbl-ppa 2022" -label_4 = "ogbl-ppa 2023" - -# Titles -title_1 = "ogbl-collab Results" -title_2 = "ogbl-ppa Results" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a subplot layout of 1x2 -fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5), sharey=True) - -# First subplot for ogbl-collab -ax1.errorbar( - collab_x, - collab_y, - yerr=collab_err, - fmt="o-", - label=label_1, - color="#3d89be", - capsize=5, -) -ax1.errorbar( - collab_x, - collab_y2, - yerr=collab_err2, - fmt="^-", - label=label_2, - color="#00BFFF", - capsize=5, -) -ax1.set_title(title_1) -ax1.set_xticks(collab_x) -ax1.set_xticklabels(collab_x, rotation=45, ha="right", fontsize=12) -ax1.set_yticks(yticks_values) -ax1.set_ylim(ylim_values) -ax1.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.5) -ax1.set_ylabel(ylabel_value, fontsize=16) -ax1.legend(loc="lower left", fontsize=12) - -# Second subplot for ogbl-ppa -ax2.errorbar( - ppa_x, - ppa_y, - yerr=ppa_err, - fmt="s--", - label=label_3, - color="#ff7f0e", - capsize=5, -) -ax2.errorbar( - ppa_x, - ppa_y2, - yerr=ppa_err2, - fmt="o-.", - label=label_4, - color="#FFA500", - capsize=5, -) -ax2.set_title(title_2) -ax2.set_xticks(ppa_x) -ax2.set_xticklabels(ppa_x, rotation=45, ha="right", fontsize=12) -ax2.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.5) -ax2.legend(loc="upper left", fontsize=12) - -# =================== -# Part 4: Saving Output -# =================== -# Enhance overall layout -plt.tight_layout() -plt.savefig('line_43.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_44.png b/ChartMimic/dataset/ori_500/line_44.png deleted file mode 100644 index 0acd40f55b061a7f9782776859c9f3e7da3b31a9..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_44.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_46.png b/ChartMimic/dataset/ori_500/line_46.png deleted file mode 100644 index 6edea6e23bc64b437917b746effbf41bd88f4056..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_46.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_47.png b/ChartMimic/dataset/ori_500/line_47.png deleted file mode 100644 index bcce3822b368758a32bdcf957e4286c374f7c4ed..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_47.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_48.py b/ChartMimic/dataset/ori_500/line_48.py deleted file mode 100644 index ab0bfe7dae8432230dc519f23c349afdc585b2a2..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_48.py +++ /dev/null @@ -1,74 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Generate new data for a complex scenario -months = np.arange(1, 13, 1) # Months of the year -sales = np.random.normal(1055, 250, len(months)) # Simulate monthly sales -temperature = ( - 5 * np.sin(0.5 * np.pi * months / 12) + 20 -) # Simulate average monthly temperature - -# Axes Limits and Labels -xlabel_value = "Month" - -ylabel_value_1 = "Sales" -ylabel_value_2 = "Temperature (°C)" - -# Labels -label_1 = "Monthly Sales" -label_2 = "Average Temperature" - -# Titles -title = "Sales and Temperature Correlation Over a Year" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the main figure and axis -fig, ax1 = plt.subplots(figsize=(10, 6)) - -# Plot sales data with primary axis -color = "tab:blue" -ax1.set_xlabel(xlabel_value) -ax1.set_ylabel(ylabel_value_1, color=color) -ax1.plot(months, sales, label=label_1, color=color, marker="o", linestyle="-") -ax1.tick_params(axis="y", labelcolor=color) -ax1.set_xticks(months) -ax1.set_title(title) - -# Create a second y-axis for temperature -ax2 = ax1.twinx() # Instantiate a second axes that shares the same x-axis -color = "tab:red" -ax2.set_ylabel( - ylabel_value_2, color=color -) # We already handled the x-label with ax1 -ax2.plot( - months, - temperature, - label=label_2, - color=color, - marker="s", - linestyle="--", -) -ax2.tick_params(axis="y", labelcolor=color) - -# Add legends to the plot -lines, labels = ax1.get_legend_handles_labels() -lines2, labels2 = ax2.get_legend_handles_labels() -ax1.legend(lines + lines2, labels + labels2, loc="upper left", frameon=True) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better spacing and display -plt.tight_layout() - -# Show the plot -plt.savefig('line_48.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_49.py b/ChartMimic/dataset/ori_500/line_49.py deleted file mode 100644 index 0357d083909933842f4b2163d4d17ebe2b6b481d..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_49.py +++ /dev/null @@ -1,133 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np - -np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -# Data preparation - -times = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] -growth = [1.18, 0.76, 0.61, 0.59, 0.45, 0.09, 0.23, 0.08, 0.06, 0.09, 0.05] -decay = [1.07, 0.41, 0.14, 0.07, 0.03, 0.08, -0.01, 0.02, -0.04, -0.13, 0.03] -oscillation = [0.09, 0.77, 1.14, -0.0, -0.75, -0.98, -0.13, 0.8, 1.0, 0.45, -0.63] - -# Extracted variables -growth_label = "Growth" -decay_label = "Decay" -oscillation_label = "Oscillation" - -xlim_values = (0, 10) -ylim_values_growth = (-0.2, 1.3) -ylim_values_decay = (-0.2, 1.3) -ylim_values_oscillation = (-1.2, 1.2) - -yticks_growth = [-0.2, 0.3, 0.8, 1.3] -yticks_decay = [-0.2, 0.3, 0.8, 1.3] -yticks_oscillation = [-1.2, -1, 0, 1, 1.2] - -xlabel_value = "Time" -ylabel_value = "Value" - -title_growth = "Exponential Growth Over Time" -title_decay = "Exponential Decay Over Time" -title_oscillation = "Oscillatory Behavior Over Time" - -legend_location = "upper center" -legend_bbox_to_anchor = (0.5, 1.15) -legend_frameon = False - -grid_linestyle = "--" -grid_alpha = 0.5 - -tick_params_color = "gray" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a 3-subplot layout -fig, axs = plt.subplots(3, 1, figsize=(6, 9)) - -# First subplot: Growth -axs[0].plot( - times, - growth, - label=growth_label, - color="green", - clip_on=False, - zorder=10, - linestyle="-", - marker="o", -) -axs[0].set_title(title_growth, y=1.1) -axs[0].set_xlim(*xlim_values) -axs[0].set_ylim(*ylim_values_growth) -axs[0].set_yticks(yticks_growth) -axs[0].set_ylabel(ylabel_value) -axs[0].legend( - loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon -) -axs[0].grid(True, linestyle=grid_linestyle, alpha=grid_alpha) -axs[0].tick_params(axis="both", which="both", color=tick_params_color) - -# Second subplot: Decay -axs[1].plot( - times, - decay, - label=decay_label, - color="red", - clip_on=False, - zorder=10, - linestyle="-", - marker="x", -) -axs[1].set_xlim(*xlim_values) -axs[1].set_ylim(*ylim_values_decay) -axs[1].set_yticks(yticks_decay) -axs[1].set_title(title_decay, y=1.1) -axs[1].set_ylabel(ylabel_value) -axs[1].legend( - loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon -) -axs[1].grid(True, linestyle=grid_linestyle, alpha=grid_alpha) -axs[1].tick_params(axis="both", which="both", color=tick_params_color) - -# Third subplot: Oscillation -axs[2].plot( - times, - oscillation, - label=oscillation_label, - clip_on=False, - zorder=10, - color="blue", - linestyle="-", - marker="s", -) -axs[2].set_title(title_oscillation, y=1.1) -axs[2].set_xlim(*xlim_values) -axs[2].set_ylim(*ylim_values_oscillation) -axs[2].set_yticks(yticks_oscillation) -axs[2].set_xlabel(xlabel_value) -axs[2].set_ylabel(ylabel_value) -axs[2].legend( - loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon -) -axs[2].grid(True, linestyle=grid_linestyle, alpha=grid_alpha) -axs[2].tick_params( - axis="both", - which="both", - color=tick_params_color, -) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better spacing and display -plt.tight_layout() - -# Show the plot -plt.savefig("line_49.pdf", bbox_inches="tight") diff --git a/ChartMimic/dataset/ori_500/line_5.py b/ChartMimic/dataset/ori_500/line_5.py deleted file mode 100644 index f7e15fcb313046dbf00e44d648b7ec1aa0074f36..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_5.py +++ /dev/null @@ -1,72 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data -digit_length = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -accuracy_direct = [0.6, 0.55, 0.1, 0.15, 0.4, 0.35, 0.2, 0.1, 0.05, 0.1] -accuracy_scratchpad = [0.5, 0.45, 0.2, 0.25, 0.3, 0.25, 0.15, 0.05, 0.0, 0.05] -accuracy_rule_following = [0.65, 0.6, 0.55, 0.5, 0.45, 0.4, 0.3, 0.2, 0.15, 0.2] - -# Labels and Plot Types -label_5_shot_direct = "5-shot direct" -label_5_shot_scratchpad = "5-shot scratchpad" -label_5_shot_rule_following = "5-shot rule-following" - -# Axes Limits and Labels -xlabel_value = "Digit Length" -ylabel_value = "Accuracy" -xlim_values = [0.6, 10.4] -ylim_values = [-0.03, 0.7] -xticks_values = range(1, 11, 1) -yticks_values = [i * 0.1 for i in range(0, 8)] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting the data -plt.figure(figsize=(6, 4)) # Adjusting figure size as per the given dimensions -plt.plot(digit_length, accuracy_direct, "o--", label=label_5_shot_direct, color="#1f77b4") -plt.plot( - digit_length, accuracy_scratchpad, "o--", label=label_5_shot_scratchpad, color="#ff7f0e" -) -plt.plot( - digit_length, - accuracy_rule_following, - "o--", - label=label_5_shot_rule_following, - color="#2ca02c", -) - -# Adding labels and title -plt.xlabel(xlabel_value, fontsize=16) -plt.ylabel(ylabel_value, fontsize=16) - -# Adjusting x and y axis limits to add some space before the start and after the end -plt.xlim(xlim_values) -plt.ylim(ylim_values) - -# Setting x and y ticks -plt.xticks(xticks_values) # X-axis from 1 to 10 with a step of 1 -plt.yticks(yticks_values) # Y-axis from 0.0 to 0.7 with a step of 0.1 - -# Adding legend outside the plot area -plt.legend(loc="upper right", fancybox=True, shadow=False) - -# Adding semi-transparent grid -plt.grid(True, which="both", linewidth=0.5, alpha=0.2) # Semi-transparent grid - -# Removing top and right borders -plt.gca().spines["top"].set_visible(False) -plt.gca().spines["right"].set_visible(False) - -# =================== -# Part 4: Saving Output -# =================== -# Adjusting layout to reduce white space -plt.tight_layout() -plt.savefig('line_5.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_50.png b/ChartMimic/dataset/ori_500/line_50.png deleted file mode 100644 index d55535460b9a532e09403e2a8e257d347c418fd2..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_50.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_51.png b/ChartMimic/dataset/ori_500/line_51.png deleted file mode 100644 index 6a5cb22e196e5cc50d73129ded886a44e1bf31e4..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_51.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_52.png b/ChartMimic/dataset/ori_500/line_52.png deleted file mode 100644 index 1ea21eb5de88a56f391d4d46c4c030d7218c6e50..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_52.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_53.png b/ChartMimic/dataset/ori_500/line_53.png deleted file mode 100644 index b72bb2621f01e586a013acdefc77ed4947e84a02..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_53.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_54.png b/ChartMimic/dataset/ori_500/line_54.png deleted file mode 100644 index b41b1e80de033610ac091af683cdea4b328a2767..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_54.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_55.png b/ChartMimic/dataset/ori_500/line_55.png deleted file mode 100644 index 407bc45894216421d26476372465f69a7fbd211c..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_55.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_56.png b/ChartMimic/dataset/ori_500/line_56.png deleted file mode 100644 index 2cafe6baf47a1516531a14f0c45699f5ad3ce3f6..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_56.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_57.png b/ChartMimic/dataset/ori_500/line_57.png deleted file mode 100644 index 2fcb56166adbbf030b93b9aacad78a1f03e2bf73..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_57.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_58.py b/ChartMimic/dataset/ori_500/line_58.py deleted file mode 100644 index a9955265005c74d335ee143f73c7c6303dd0c2da..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_58.py +++ /dev/null @@ -1,66 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -# Enhanced seaborn style for a fancier look -iterations = np.linspace(0, 200, 200) - -# Simulated data based on the previous setup -base_data = np.linspace(0.5, 0.2, 200) * (1 + np.random.normal(0, 0.05, 200)) -ours_data = np.linspace(0.4, 0.3, 200) * (1 + np.random.normal(0, 0.05, 200)) - -# Axes Limits and Labels -xlabel_value = "Training Iterations" -ylabel_value = "Metric Value" -ylim_values = [0.15, 0.76] - -# Labels -labels = ["Base Model", "Our Model"] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a 1x2 subplot layout -fig, axs = plt.subplots(1, 2, figsize=(10, 4)) - -colors = ["#0072B2", "#D55E00"] # Blue and orange colors for the lines - -# Plot the data in each subplot -for i, ax in enumerate(axs.flat): - ax.plot( - iterations, - base_data * (1 + 0.1 * np.random.randn(1)), - label=labels[0], - color=colors[0], - marker="o", - markersize=3, - linewidth=2, - ) - ax.plot( - iterations, - ours_data * (1 + 0.1 * np.random.randn(1)), - label=labels[1], - color=colors[1], - marker="x", - markersize=3, - linewidth=2, - ) - ax.set_title(f"Metric {i+1}") - ax.set_xlabel(xlabel_value) - ax.set_ylabel(ylabel_value) - ax.set_ylim(ylim_values) # Ensure consistent y-axis limits - ax.legend(loc="upper right", frameon=True) # Add a legend - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better spacing and display -plt.tight_layout() - -# Show the plot -plt.savefig('line_58.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_59.py b/ChartMimic/dataset/ori_500/line_59.py deleted file mode 100644 index ad6d1b6561dfe27f2ad13b68d2aefd9fd6191eec..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_59.py +++ /dev/null @@ -1,81 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data for the plot -iterations = np.linspace(0, 200, 50) -base_data_1 = np.linspace(0.5, 0.2, 50) * (1 + np.random.normal(0, 0.05, 50)) -ours_data_1 = np.linspace(0.4, 0.3, 50) * (1 + np.random.normal(0, 0.05, 50)) - -# Axes Limits and Labels -xlabel_value = "Training Iterations" - -ylabel_value = "Metric Value" -ylim_values = [0.05, 0.9] - -# Labels -label_Base_Model="Base Model" -label_Our_Model="Our Model" - -# Titles -title = "Accuracy" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Customization options -color = "deepskyblue" -marker = "o" -style = "-" - -# Create a figure and axis -fig, ax = plt.subplots(figsize=(5, 3)) - -# Plot the data -ax.plot( - iterations, - base_data_1, - label=label_Base_Model, - color=color, - marker=marker, - markersize=5, - linestyle=style, - linewidth=2, -) -ax.plot( - iterations, - ours_data_1, - label=label_Our_Model, - color=color, - marker=marker, - markersize=5, - linestyle=style, - linewidth=2, - alpha=0.6, -) - -# Enhance the plot with a title, labels, and legend -ax.set_title(title) -ax.set_xlabel(xlabel_value) -ax.set_ylabel(ylabel_value) - -# Add a legend to the plot -ax.set_ylim(ylim_values) - -# Show the plot -ax.legend(loc="upper right", frameon=True, shadow=True) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better spacing and display -plt.tight_layout() - -# Save the plot -plt.savefig('line_59.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_69.png b/ChartMimic/dataset/ori_500/line_69.png deleted file mode 100644 index 8bd82648d253c013247ff92f044c2314250625c5..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_69.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_69.py b/ChartMimic/dataset/ori_500/line_69.py deleted file mode 100644 index 63972bb1ba9eb50092d7e6ebb1d037c60c5a048d..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_69.py +++ /dev/null @@ -1,95 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data for the plot -microphones = np.array([2, 3, 4, 5, 6, 7, 8]) -libricss_wer = np.clip( - np.sin(np.linspace(0, 2 * np.pi, len(microphones))) - + np.random.normal(0, 0.1, len(microphones)), - 0.2, - 0.9, -) -ami_wer = np.clip( - np.cos(np.linspace(0, 2 * np.pi, len(microphones))) - + np.random.normal(0, 0.1, len(microphones)), - 0.3, - 1, -) -# Axes Limits and Labels -xlabel_value = "Number of Microphones" - -ylabel_value_1 = "WER(%)" -ylabel_value_2 = "AMI WER(%)" - -# Labels -label_1 = "LibriCSS WER" -label_2 = "AMI WER" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a figure and axis -fig, ax = plt.subplots(figsize=(8, 5)) - -(libricss_line,) = ax.plot( - microphones, - libricss_wer, - "o-", - color="#ff8b26", - label=label_1, - markersize=8, - linewidth=2, -) -ax.set_xlabel(xlabel_value, fontsize=12) -ax.set_ylabel(ylabel_value_1, fontsize=12) -ax.tick_params(axis="y", direction="in", labelsize=10) -ax.tick_params(axis="x", direction="in", labelsize=10) - -# Create a secondary y-axis for AMI WER -(ami_line,) = ax.plot( - microphones, - ami_wer, - "s--", - color="#0392fb", - label=label_2, - markersize=8, - linewidth=2, -) - -# Add a legend to the plot -threshold = 0.7 -ax.axhline(y=threshold, color="red", linestyle="-", linewidth=1.5, label="Threshold") - -# Highlight the data points above the threshold -highlight = [3, 5, 7] # Microphones to highlight -for mic in highlight: - ax.plot( - mic, libricss_wer[np.where(microphones == mic)], "ro" - ) # Highlight LibriCSS WER - ax.annotate( - f"Highlight {mic}", - (mic, libricss_wer[np.where(microphones == mic)]), - textcoords="offset points", - xytext=(0, 10), - ha="center", - ) - -# Customize the plot with labels, title, and legend -ax.legend() - -# Add a grid to the plot -ax.grid(True, linestyle="--", alpha=0.6) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better spacing and display -plt.tight_layout() -plt.savefig('line_69.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_77.py b/ChartMimic/dataset/ori_500/line_77.py deleted file mode 100644 index 34d91e6a02091a35f8048e5fe4914ce64935c89c..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_77.py +++ /dev/null @@ -1,85 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Sample data generation -models = ["Llama", "Falcon", "Qwen"] -configurations = ["Config A", "Config B", "Config C"] -iterations = np.arange(1, 11) - -data = { - "Llama": { - "Config A": np.random.rand(10) * 10 + 80, - "Config B": np.random.rand(10) * 10 + 75, - "Config C": np.random.rand(10) * 10 + 85, - }, - "Falcon": { - "Config A": np.random.rand(10) * 10 + 60, - "Config B": np.random.rand(10) * 10 + 65, - "Config C": np.random.rand(10) * 10 + 55, - }, - "Qwen": { - "Config A": np.random.rand(10) * 10 + 70, - "Config B": np.random.rand(10) * 10 + 75, - "Config C": np.random.rand(10) * 10 + 65, - }, -} -# Axes Limits and Labels -xlabel_value = "Iteration" -ylabel_value = "Score" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plotting setup -fig, axs = plt.subplots(3, 1, figsize=(8, 12), sharex=True) - -# Styling choices -colors = ["#ff69b4", "#00fa9a", "#1e90ff"] # Brighter, more vivid colors -markers = ["p", "*", "h"] # More complex marker styles -line_styles = [":", "-.", "--"] # More distinct line styles - -# Custom background styling -fig.set_facecolor("#f0f0f0") -for ax in axs: - ax.set_facecolor("#f7f7f7") - -# Plotting -for idx, model in enumerate(models): - ax = axs[idx] - ax.grid(color="gray", linestyle=":", linewidth=0.5) # Lighter grid - for config, color, marker, line_style in zip( - configurations, colors, markers, line_styles - ): - scores = data[model][config] - ax.plot( - iterations, - scores, - marker=marker, - color=color, - label=f"{config} - {model}", - linestyle=line_style, - markersize=10, - ) - ax.set_title(f"Performance of {model}", fontsize=14) - ax.set_xlabel(xlabel_value, fontsize=12) - ax.set_ylabel(ylabel_value, fontsize=12) - ax.legend( - loc="upper left", fancybox=True, framealpha=1, shadow=True, borderpad=1 - ) - # Enhanced visibility - for spine in ax.spines.values(): - spine.set_visible(True) - spine.set_color("#dddddd") - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig('line_77.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_78.png b/ChartMimic/dataset/ori_500/line_78.png deleted file mode 100644 index 5ff93e291aa20239431e70ba89e0e196dd908af3..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_78.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_78.py b/ChartMimic/dataset/ori_500/line_78.py deleted file mode 100644 index 89d0017944835b4c7ef8761ba6892792b3883942..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_78.py +++ /dev/null @@ -1,68 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - -from matplotlib.colors import LinearSegmentedColormap - -# =================== -# Part 2: Data Preparation -# =================== -# Time series data: Quarterly sales growth for 6 brands over 2 years (8 quarters) -quarters = ["Q1", "Q2", "Q3", "Q4", "Q1_2", "Q2_2", "Q3_2", "Q4_2"] -sales_growth = { - "Brand A": np.random.rand(8) + np.linspace(0.5, 2, 8), - "Brand B": np.random.rand(8) + np.linspace(0.5, 2, 8), - "Brand C": np.random.rand(8) + np.linspace(0.5, 2, 8), - "Brand D": np.random.rand(8) + np.linspace(0.5, 2, 8), - "Brand E": np.random.rand(8) + np.linspace(0.5, 2, 8), - "Brand F": np.random.rand(8) + np.linspace(0.5, 2, 8), -} -# Axes Limits and Labels -xlabel_value = "Quarter" -ylabel_value = "Sales Growth" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Creating custom gradient color maps for each brand -colors = ["#ff5f6d", "#36d1dc", "#cc2b5e", "#11998e", "#aa076b", "#ffd89b"] - -# Plot setup -fig, axs = plt.subplots(3, 2, figsize=(10, 10)) # 3x2 subplot grid -axs = axs.flatten() - -# Markers and line styles for diversity -markers = ["o", "^", "s", "p", "*", "x"] -line_styles = ["-", "--", "-.", ":", "-", "--"] - -# Plot each brand with its distinct color gradient and style -for ax, (brand, sales), color, marker, line_style in zip( - axs, sales_growth.items(), colors, markers, line_styles -): - points = ax.plot( - quarters, - sales, - label=f"{brand} Sales Growth", - marker=marker, - linestyle=line_style, - linewidth=2, - color=color, - ) - ax.plot( - quarters, sales, marker=marker, linestyle=line_style, color=color, linewidth=2 - ) - ax.set_title(f"{brand}", fontsize=14) - ax.set_xlabel(xlabel_value, fontsize=12) - ax.set_ylabel(ylabel_value, fontsize=12) - ax.set_facecolor("#f0f0f0") # Light grey background for clarity - ax.grid(True, linestyle="--", alpha=0.5) - ax.legend(loc="upper left") - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig('line_78.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_79.png b/ChartMimic/dataset/ori_500/line_79.png deleted file mode 100644 index 338f47c981457e46f6c4efa332a5ba2db1207e71..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_79.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/line_79.py b/ChartMimic/dataset/ori_500/line_79.py deleted file mode 100644 index a21ee49dfd94f347df9bbbee48dd029e982d6162..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/line_79.py +++ /dev/null @@ -1,56 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -x = np.linspace(50, 750, 5) -y_data = { - "Traffic": np.random.normal(0.18, 0.2, (2, 5)).cumsum(axis=1), - "ETMm2": np.random.normal(0.12, 0.2, (2, 5)).cumsum(axis=1), - "ETTh2": np.abs( - np.sin(np.linspace(0, 3, 5)) * 0.1 - + np.array([[0.15, 0.18, 0.16, 0.17, 0.15], [0.2, 0.22, 0.21, 0.19, 0.2]]) - ), - "ECL": np.random.exponential(0.2, (2, 5)) - + np.array([[0.3, 0.32, 0.34, 0.35, 0.33], [0.28, 0.3, 0.31, 0.29, 0.27]]), -} -# Axes Limits and Labels -xlabel_value = "Time (s)" -xticks_values = [100, 300, 500, 700] - -ylabel_value = "Metric Value" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create figure and subplots -fig, axs = plt.subplots(1, 4, figsize=(18, 4), facecolor="whitesmoke") - -# Customize colors and markers -colors = ["#1f77b4", "#ff7f0e"] -markers = ["o-", "s-"] -datasets = ["Traffic", "ETMm2", "ETTh2", "ECL"] - -for i, ax in enumerate(axs): - for j in range(2): - y = y_data[datasets[i]][j] - ax.plot(x, y, markers[j], label=f"{datasets[i]} Run {j+1}", color=colors[j]) - ax.set_xticks(xticks_values) - ax.set_title(f"{datasets[i]} Performance", fontsize=16) - ax.set_xlabel(xlabel_value, fontsize=12) - ax.set_ylabel(ylabel_value, fontsize=12) - ax.grid(True, linestyle="--", which="both", color="gray", alpha=0.5) - -# Adjust layout and display legend -plt.legend(loc="center", bbox_to_anchor=(-1.5, -0.3), ncol=4, fontsize=14) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig('line_79.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/line_80.png b/ChartMimic/dataset/ori_500/line_80.png deleted file mode 100644 index c92f677d0739d62079c92e31068ed0394c759f57..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/line_80.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/pie_10.py b/ChartMimic/dataset/ori_500/pie_10.py deleted file mode 100644 index 56fb11243774904aef6e14369fe09fb504afffc0..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/pie_10.py +++ /dev/null @@ -1,52 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -recipe = [ - "225 g flour", - "90 g sugar", - "1 egg", - "60 g butter", - "100 ml milk", - "1/2 package of yeast", -] - -data = [225, 90, 50, 60, 100, 5] -title = "Matplotlib bakery: A donut" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig, ax = plt.subplots(figsize=(6, 4), subplot_kw=dict(aspect="equal")) -wedges, texts = ax.pie(data, wedgeprops=dict(width=0.5), startangle=-40) - -bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72) -kw = dict(arrowprops=dict(arrowstyle="-"), bbox=bbox_props, zorder=0, va="center") - -for i, p in enumerate(wedges): - ang = (p.theta2 - p.theta1) / 2.0 + p.theta1 - y = np.sin(np.deg2rad(ang)) - x = np.cos(np.deg2rad(ang)) - horizontalalignment = {-1: "right", 1: "left"}[int(np.sign(x))] - connectionstyle = f"angle,angleA=0,angleB={ang}" - kw["arrowprops"].update({"connectionstyle": connectionstyle}) - ax.annotate( - recipe[i], - xy=(x, y), - xytext=(1.35 * np.sign(x), 1.4 * y), - horizontalalignment=horizontalalignment, - **kw, - ) - -ax.set_title(title) - -# =================== -# Part 4: Saving Output -# =================== -plt.tight_layout() -plt.savefig('pie_10.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/pie_8.py b/ChartMimic/dataset/ori_500/pie_8.py deleted file mode 100644 index 24f24613f27af3cbdb9bfc128d564ab8e666c374..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/pie_8.py +++ /dev/null @@ -1,58 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Data to plot -labels = ["NAACL", "EMNLP", "ACL", "COLING", "EACL"] -sizes = [25.4, 20.3, 34.7, 12.2, 7.4] -colors = plt.cm.Paired(np.linspace(0, 1, len(sizes))) -explode = (0, 0, 0.1, 0, 0) # only "explode" the 3rd slice (Instagram) -title = "NLP Conference Influence" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Plot setup -fig, ax = plt.subplots(figsize=(6, 6)) -wedges, texts, autotexts = ax.pie( - sizes, - explode=explode, - colors=colors, - autopct="%1.1f%%", - shadow=False, - startangle=140, -) - -# Adding annotations -bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72) -kw = dict(arrowprops=dict(arrowstyle="-"), bbox=bbox_props, zorder=0, va="center") - -for i, p in enumerate(wedges): - ang = (p.theta2 - p.theta1) / 2.0 + p.theta1 - y = np.sin(np.deg2rad(ang)) - x = np.cos(np.deg2rad(ang)) - horizontalalignment = {-1: "right", 1: "left"}[int(np.sign(x))] - connectionstyle = "angle,angleA=0,angleB={}".format(ang) - kw["arrowprops"].update({"connectionstyle": connectionstyle}) - ax.annotate( - labels[i], - xy=(x, y), - xytext=(1.35 * np.sign(x), 1.2 * y), - horizontalalignment=horizontalalignment, - **kw - ) - -# Title and equal axis -ax.set_title(title, fontsize=16, x=0.5, y=1) - -# =================== -# Part 4: Saving Output -# =================== -# Show plot -plt.tight_layout() -plt.savefig('pie_8.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/radar_18.py b/ChartMimic/dataset/ori_500/radar_18.py deleted file mode 100644 index 70167ee326ccefccd5192b6e91e2d62abc6384a9..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/radar_18.py +++ /dev/null @@ -1,125 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import numpy as np; np.random.seed(0) - -import matplotlib.pyplot as plt -from matplotlib.lines import Line2D - -# =================== -# Part 2: Data Preparation -# =================== -# Data for Disney and Universal Studios -values_disney = [0.8, 0.7, 0.6, 0.85, 0.9, 0.75, 0.7, 0.65, 0.8, 0.9] -values_universal = [0.6, 0.55, 0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.34, 0.55] -labels = [ - "Thrill Rides", - "Family Rides", - "Shows", - "Food Quality", - "Staff", - "Cleanliness", - "Wait Times", - "Ticket Price", - "Souvenirs", - "Parking", -] -num_vars = len(labels) - -# Compute angle for each axis -angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist() - -# The plot is circular, so we need to "complete the loop" and append the start to the end. -values_disney += values_disney[:1] -values_universal += values_universal[:1] -angles += angles[:1] - -# Extracted variables -disney_label = "Disney" -universal_label = "Universal Studios" -xticks = angles[:-1] -xticklabels = labels -yticklabels = [] -rgrids = [0.2, 0.4, 0.6, 0.8, 1.0] -rgrid_labels = ["0.2", "0.4", "0.6", "0.8", "1.0"] -title_text = "Amusement Park Comparison: Disney vs Universal Studios" -title_size = 18 -title_color = "navy" -title_y = 1.1 - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Draw the radar chart -fig, ax = plt.subplots(figsize=(8, 8), subplot_kw=dict(polar=True)) -ax.fill(angles, values_disney, color="darkorange", alpha=0.7) -ax.plot(angles, values_disney, color="darkorange", linewidth=2, label=disney_label) -ax.scatter( - angles[:-1], values_disney[:-1], color="darkorange", s=75, zorder=5, marker="^" -) -ax.fill(angles, values_universal, color="purple", alpha=0.7) -ax.plot( - angles, values_universal, color="purple", linewidth=2, label=universal_label -) -ax.scatter( - angles[:-1], values_universal[:-1], color="purple", s=75, zorder=5, marker="o" -) - -# Add labels to the plot -ax.set_xticks(xticks) -ax.set_xticklabels(xticklabels, size=13) - -# Add grid lines and labels for the concentric circles -ax.set_yticklabels(yticklabels) -ax.set_rgrids( - rgrids, - labels=rgrid_labels, - angle=225, - color="gray", - size=12, -) - -# Create legend handles manually -legend_elements = [ - Line2D( - [0], - [0], - color="darkorange", - linewidth=2, - marker="^", - markersize=10, - label=disney_label, - ), - Line2D( - [0], - [0], - color="purple", - linewidth=2, - marker="o", - markersize=10, - label=universal_label, - ), -] - -# Add legend and title -ax.set_title( - title_text, - size=title_size, - color=title_color, - y=title_y, -) -ax.legend( - handles=legend_elements, - loc="lower center", - bbox_to_anchor=(0.5, -0.2), - frameon=False, - ncol=2, -) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and save the plot -plt.tight_layout() -plt.savefig('radar_18.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/radar_19.png b/ChartMimic/dataset/ori_500/radar_19.png deleted file mode 100644 index 2df50cd1bfd4ad70433002039ed211fcdafd3002..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/radar_19.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/radar_19.py b/ChartMimic/dataset/ori_500/radar_19.py deleted file mode 100644 index db07e744d9ca04ac96329ddbb8d07216a04ee4c8..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/radar_19.py +++ /dev/null @@ -1,85 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import numpy as np; np.random.seed(0) - -import matplotlib.pyplot as plt -from math import pi - -# =================== -# Part 2: Data Preparation -# =================== -# Define the data for the radar chart -categories = [ - "Sillage", - "Longevity", - "Creativity", - "Versatility", - "Projection", - "Value", - "Popularity", - "Packaging", -] -values1 = [8, 6, 7, 5, 6, 7, 8, 9] # Values for Chanel -values2 = [7, 7.5, 8, 6, 7, 5, 8.5, 7] # Values for Dior -values3 = [5, 7, 6.5, 8, 7, 6, 7, 7.5] # Values for Gucci - -# Number of variables -N = len(categories) - -# Compute angle for each category -angles = [n / float(N) * 2 * pi for n in range(N)] -values1 += values1[:1] -values2 += values2[:1] -values3 += values3[:1] -angles += angles[:1] - -# Extracted variables -xticks = angles[:-1] -xtickslabel = categories -yticks = [1, 3, 5, 7, 9] -ytickslabel = ["1", "3", "5", "7", "9"] -ylim = (0, 10) -line_label1 = "Chanel" -line_label2 = "Dior" -line_label3 = "Gucci" - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Initialize the spider plot -fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True)) - -# Draw one axe per variable and add labels -plt.xticks(xticks, xtickslabel, color="navy", size=8) -ax.tick_params(pad=15) # Adjust the distance of the label from the axis - -# Draw ylabels -ax.set_rlabel_position(30) -plt.yticks(yticks, ytickslabel, color="darkblue", size=7) -plt.ylim(ylim) - -# Plot data -ax.plot(angles, values1, linewidth=2, linestyle="dashed", label=line_label1, color="gold") -ax.fill(angles, values1, color="yellow", alpha=0.25) - -ax.plot(angles, values2, linewidth=2, linestyle="dashed", label=line_label2, color="silver") -ax.fill(angles, values2, color="lightgrey", alpha=0.25) - -ax.plot(angles, values3, linewidth=2, linestyle="solid", label=line_label3, color="green") -ax.fill(angles, values3, color="lightgreen", alpha=0.25) - -# Add legend -plt.legend(loc="upper right", bbox_to_anchor=(1.2, 1.2), ncol=3, frameon=False) - -# Set the background color inside the radar chart to white -ax.set_facecolor("white") - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better fit -plt.tight_layout() - -plt.savefig('radar_19.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/radar_8.py b/ChartMimic/dataset/ori_500/radar_8.py deleted file mode 100644 index 43b9bac7f714a9971a22322b1d1554975b9369ed..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/radar_8.py +++ /dev/null @@ -1,102 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -# Data for each method -labels = np.array( - [ - "Long-horizon\nForecasting", - "Imputation", - "Anomaly\nDetection", - "Short-horizon\nForecasting", - "Classification", - ] -) -stats_moment = np.array([80, 70, 40, 85, 75]) -stats_gpt4ts = np.array([55, 80, 85, 80, 40]) -stats_timesnet = np.array([70, 35, 80, 75, 80]) - -# Number of variables -num_vars = len(labels) - -# Compute angle for each axis -angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist() - -# The plot is made circular, so we need to "complete the loop" and append the start to the end. -stats_moment = np.concatenate((stats_moment, [stats_moment[0]])) -stats_gpt4ts = np.concatenate((stats_gpt4ts, [stats_gpt4ts[0]])) -stats_timesnet = np.concatenate((stats_timesnet, [stats_timesnet[0]])) -angles += angles[:1] - -# Extracted variables -label_moment = "MOMENT" -label_gpt4ts = "GPT4TS" -label_timesnet = "TimesNet" -xlim_values = None # Not specified in the code -ylim_values = (0, 100) -xlabel_value = None # Not specified in the code -ylabel_value = None # Not specified in the code -xticks_values = angles[:-1] -yticks_values = [20, 40, 60, 80] -xtickslabel_values = labels -ytickslabel_values = [] # Empty list as specified in plt.yticks -title_value = None # Not specified in the code -axhline_value = None # Not specified in the code -axvline_value = None # Not specified in the code - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Size of the figure -fig, ax = plt.subplots(figsize=(5, 5), subplot_kw=dict(polar=True)) - -# Draw one axe per variable and add labels with increased padding -plt.xticks(xticks_values, xtickslabel_values) -ax.tick_params(pad=23) # Increase the distance of the label from the axis - -# Draw ylabels and set them to be dashed -ax.set_rlabel_position(0) -plt.yticks(yticks_values, ytickslabel_values, color="grey", size=7) -plt.ylim(ylim_values) - -# Customizing the grid (set grid to be dashed) -ax.yaxis.grid(True, linestyle="--", color="grey", linewidth=0.5) - -# Plot data -ax.plot( - angles, stats_moment, color="red", linewidth=1, linestyle="solid", label=label_moment -) -ax.fill(angles, stats_moment, color="red", alpha=0.25) - -ax.plot( - angles, stats_gpt4ts, color="blue", linewidth=1, linestyle="dashed", label=label_gpt4ts -) -ax.fill(angles, stats_gpt4ts, color="blue", alpha=0.25) - -ax.plot( - angles, - stats_timesnet, - color="green", - linewidth=1, - linestyle="dotted", - label=label_timesnet, -) -ax.fill(angles, stats_timesnet, color="green", alpha=0.25) - -# Add legend -plt.legend(loc="lower center", bbox_to_anchor=(0.5, -0.3), ncol=3, frameon=False) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better fit -plt.tight_layout() - -# Show the plot -plt.savefig('radar_8.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_1.png b/ChartMimic/dataset/ori_500/scatter_1.png deleted file mode 100644 index f634bcb1adc57a0e150da1d091743b00e985a583..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_1.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_1.py b/ChartMimic/dataset/ori_500/scatter_1.py deleted file mode 100644 index bfa33d0925f399c23f5978aa85b0c7a3b4bb56df..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_1.py +++ /dev/null @@ -1,52 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -models = [ - "gpt-4", - "text-davinci-003", - "text-davinci-002", - "claude-1", - "claude-2", - "text-bison@002", - "hf_falcon-40b", - "llama-2-70", - "llama-2-70-chat", -] -values = { - "Model-Basedness": [2, 1.5, 1.8, 1.2, 1.6, 1.4, 1.9, 1.1, 1.3], - "Meta-Cognition": [0.8, 0.6, 0.7, 0.5, 0.9, 0.4, 1.0, 0.3, 0.2], - "Exploration": [0.3, 0.5, 0.4, 0.6, 0.2, 0.7, 0.1, 0.8, 0.9], - "Risk Taking": [0.9, 0.7, 0.8, 0.6, 1.0, 0.5, 0.4, 0.2, 0.3], - "Bayesian Reasoning": [0.2, 0.4, 0.3, 0.5, 0.1, 0.6, 0.7, 0.9, 0.8], - "Simple Bandits": [0.5, 0.3, 0.4, 0.2, 0.6, 0.1, 0.7, 0.8, 0.9], -} -colors = ["blue", "orange", "green", "red", "purple", "brown"] - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create subplots -fig, axes = plt.subplots(1, 6, figsize=(12, 4), sharey=True) - -# Plot each category -for ax, (category, color) in zip(axes, zip(values.keys(), colors)): - ax.scatter(values[category], models, color=color) - ax.set_title(category) - ax.set_xlim(0, 2) - ax.axvline(x=1, color="black", linestyle="--", linewidth=1) - -# Set common labels -fig.text(0.5, 0.04, "Value", ha="center", va="center") - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and show plot -plt.tight_layout(rect=[0.03, 0.05, 1, 0.95]) -plt.savefig('scatter_1.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_13.py b/ChartMimic/dataset/ori_500/scatter_13.py deleted file mode 100644 index 3b64257fdf0e545e0b861f4657fae0ebbe36880c..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_13.py +++ /dev/null @@ -1,89 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -test_case_index = [1, 2, 3, 4, 5] -single_lstm_error = [0.08, 0.06, 0.07, 0.05, 0.05] -ensemble_lstm_error = [0.04, 0.03, 0.04, 0.03, 0.04] -cae_reconstruction_error = [0.01, 0.02, 0.01, 0.02, 0.01] - -# Labels and Titles -xlabel = "Test Case Index" -ylabel = "Average Relative Error, u" -title = "Average Relative Error, u" - -# Legend labels -single_lstm_label = "Single LSTM" -ensemble_lstm_label = "Ensemble LSTM" -cae_reconstruction_label = "CAE Reconstruction" - -# Plot limits -xlim_values = (1.0, 5.0) -ylim_values = (0.01, 0.08) - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Set figure size in inches to match the original image's dimensions -plt.figure(figsize=(8, 6)) - -# Plotting the data with adjusted marker sizes -plt.scatter( - test_case_index, - single_lstm_error, - label=single_lstm_label, - color="blue", - clip_on=False, - zorder=10, - marker="^", - s=150, -) # Adjusted marker size -plt.scatter( - test_case_index, - ensemble_lstm_error, - label=ensemble_lstm_label, - clip_on=False, - zorder=10, - color="green", - marker="s", - s=150, -) # Adjusted marker size -plt.scatter( - test_case_index, - cae_reconstruction_error, - label=cae_reconstruction_label, - clip_on=False, - zorder=10, - color="black", - marker="o", - s=100, -) # Adjusted marker size - -# Adding labels and title -plt.xlabel(xlabel) -plt.ylabel(ylabel) -plt.title(title, y=1.1) - -# Adding a legend with adjusted order -handles, labels = plt.gca().get_legend_handles_labels() -order = [2, 1, 0] # Adjusted order to match the reference picture -plt.legend([handles[idx] for idx in order], [labels[idx] for idx in order]) - -plt.legend(loc="upper right", ncol=3, bbox_to_anchor=(1, 1.08), frameon=False) -plt.xlim(*xlim_values) -plt.ylim(*ylim_values) -# Show grid -plt.grid(True) - -# =================== -# Part 4: Saving Output -# =================== -# Show the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig('scatter_13.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_16.py b/ChartMimic/dataset/ori_500/scatter_16.py deleted file mode 100644 index 36b8347036fb389176536934984f580114f3bd0a..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_16.py +++ /dev/null @@ -1,78 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -efficiency = [ - 15, - 20, - 25, - 30, - 35, - 40, - 45, - 50, -] # Renewable energy efficiency values in percentage -carbon_reduction = [ - 5, - 45, - 23, - 42, - 23, - 10, - 2, - 0, -] # Corresponding carbon reduction percentages -energy_sources = [ - "Solar", - "Wind", - "Hydro", - "Geothermal", - "Biomass", - "Nuclear", - "Tidal", - "Wave", -] -colors = [ - "yellow", - "blue", - "aqua", - "brown", - "green", - "orange", - "purple", - "red", -] # Colors representing different energy sources -markers = ["o", "o", "o", "o", "o", "o", "o", "x"] # Different marker for 'Wave' -xlabel = "Efficiency (%)" -ylabel = "Carbon Reduction (%)" -legend_title = "Energy Source" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create figure and axis -fig, ax = plt.subplots(figsize=(8, 4)) - -# Plot each point with corresponding color and marker -for i, (eff, carbon, color, marker) in enumerate( - zip(efficiency, carbon_reduction, colors, markers) -): - ax.scatter(eff, carbon, color=color, marker=marker, label=energy_sources[i]) - -# Set labels and title -ax.set_xlabel(xlabel) -ax.set_ylabel(ylabel) - -# Create legend -legend = ax.legend(title=legend_title, bbox_to_anchor=(1.05, 1), loc="upper left") - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout to make room for the legend -plt.tight_layout() -plt.savefig('scatter_16.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_17.py b/ChartMimic/dataset/ori_500/scatter_17.py deleted file mode 100644 index 35e10e755d36231e972219f20ebad065536de278..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_17.py +++ /dev/null @@ -1,37 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Simulating data for the left plot -x_main = np.random.normal(-10, 10, 100) -y_main = np.random.normal(10, 10, 100) -xlabel = "Δ Robust Accuracy (%)" -ylabel = "Δ RNFR (%)" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the main figure and axis -plt.figure(figsize=(9, 6)) - -# Scatter plot for the left plot -colors = np.random.rand(100) -sizes = 1000 * np.random.rand(100) -plt.scatter(x_main, y_main, c=colors, s=sizes, alpha=0.3, cmap="viridis") -plt.grid(True) - -# Set labels and title for the plot -plt.xlabel(xlabel) -plt.ylabel(ylabel) - -# =================== -# Part 4: Saving Output -# =================== -# Show the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig('scatter_17.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_2.png b/ChartMimic/dataset/ori_500/scatter_2.png deleted file mode 100644 index 8a5a3629d7d812937be5fe5a980d059d255cda45..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_2.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_20.png b/ChartMimic/dataset/ori_500/scatter_20.png deleted file mode 100644 index b5e6a4bb643ca9987a8f301435816136c1ed5aa5..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_20.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_22.py b/ChartMimic/dataset/ori_500/scatter_22.py deleted file mode 100644 index f91f7e780d7717fe6b85d80d7a6b2d4eaebaf619..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_22.py +++ /dev/null @@ -1,68 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -models = [ - "gpt-4", - "text-davinci-003", - "text-davinci-002", - "claude-1", - "claude-2", - "text-bison@002", - "hf_falcon-40b", - "llama-2-70", - "llama-2-70-chat", -] -values = { - "Model-Basedness": [2, 1.5, 1.8, 1.2, 1.6, 1.4, 1.9, 1.1, 1.3], - "Meta-Cognition": [0.8, 0.6, 0.7, 0.5, 0.9, 0.4, 1.0, 0.3, 0.2], - "Exploration": [0.3, 0.5, 0.4, 0.6, 0.2, 0.7, 0.1, 0.8, 0.9], - "Risk Taking": [0.9, 0.7, 0.8, 0.6, 1.0, 0.5, 0.4, 0.2, 0.3], - "Bayesian Reasoning": [0.2, 0.4, 0.3, 0.5, 0.1, 0.6, 0.7, 0.9, 0.8], - "Simple Bandits": [0.5, 0.3, 0.4, 0.2, 0.6, 0.1, 0.7, 0.8, 0.9], -} -categorys1 = ["Model-Basedness", "Meta-Cognition"] -colors1 = ["blue", "orange"] -categorys2 = ["Exploration", "Risk Taking"] -colors2 = ["green", "red"] -titles = ["Performance Comparison", "Strategic Traits"] -xlabel = "Value" -ylabel = "Models" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create subplots -fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 6), sharey=True) - -# Plotting for ax1 - first two categories -for category, color in zip(categorys1, colors1): - ax1.scatter(values[category], models, color=color, label=category) -ax1.set_title(titles[0]) -ax1.set_xlabel(xlabel) -ax1.set_ylabel(ylabel) -ax1.legend() - -# Plotting for ax2 - next two categories -for category, color in zip(categorys2, colors2): - ax2.scatter(values[category], models, color=color, label=category) -ax2.set_title(titles[1]) -ax2.set_xlabel(xlabel) -ax2.legend() - -# Common settings -for ax in [ax1, ax2]: - ax.set_yticks(range(len(models))) - ax.set_yticklabels(models) - ax.grid(True, linestyle="--", alpha=0.6) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and show plot -plt.tight_layout() -plt.savefig('scatter_22.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_23.py b/ChartMimic/dataset/ori_500/scatter_23.py deleted file mode 100644 index 5a239397d8b378004f921ab559e26719f324fbb9..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_23.py +++ /dev/null @@ -1,70 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data for plotting -models = [ - "GPT4", - "Mixtal-8x7B", - "MPT-7B", - "Llama2-70B", - "Falcom-40B", - "Davinci-003", - "Davinci-002", - "Claude-2", - "Claude-1", -] -values = { - "Model-Basedness": [1.8, 1.5, 1.8, 1.2, 1.6, 1.4, 1.9, 1.1, 1.3], - "Meta-Cognition": [0.8, 0.6, 0.7, 0.5, 0.9, 0.4, 1.0, 0.3, 0.2], - "Exploration": [0.3, 0.5, 0.4, 0.6, 0.2, 0.7, 0.1, 0.8, 0.9], - "Risk Taking": [0.9, 0.7, 0.8, 0.6, 1.0, 0.5, 0.4, 0.2, 0.3], - "Bayesian Reasoning": [0.2, 0.4, 0.3, 0.5, 0.1, 0.6, 0.7, 0.9, 0.8], - "Simple Bandits": [0.5, 0.3, 0.4, 0.2, 0.6, 0.1, 0.7, 0.8, 0.9], -} -colors = ["blue", "orange", "green", "red", "purple", "brown"] -xlabel = "Models" -ylabel = "Score" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create subplots 2x2 -fig, axs = plt.subplots(2, 2, figsize=(8, 8), sharey=True) -axes = axs.flatten() - -# Plot each category -for ax, (category, color) in zip(axes, zip(values.keys(), colors)): - ax.scatter( - models, - values[category], - color=color, - label=category, - s=100, - edgecolor="black", - alpha=0.6, - marker="o", - ) - ax.set_title(category) - ax.set_xticks(models) - ax.set_xticklabels(models, rotation=45, ha="right") - ax.set_xlabel(xlabel) - ax.set_ylabel(ylabel) - ax.legend() - -# Enhance style -for ax in axes: - ax.spines["top"].set_visible(False) - ax.spines["right"].set_visible(False) - ax.grid(True, linestyle="--", alpha=0.5) - ax.set_ylim(0, 2) # Ensure all plots have the same y-axis limits - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout and save plot -plt.tight_layout() -plt.savefig('scatter_23.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_4.png b/ChartMimic/dataset/ori_500/scatter_4.png deleted file mode 100644 index f636e99e6e889e5d295f6dc2072e7adc3e277e25..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_4.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_4.py b/ChartMimic/dataset/ori_500/scatter_4.py deleted file mode 100644 index 1899a3f86b8d6c349d547119da87466c04fcb734..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_4.py +++ /dev/null @@ -1,59 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== - -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - -# =================== -# Part 2: Data Preparation -# =================== -clusters = { - "cluster_1": np.array([[-1.29, 0.27], [-0.04, -1.17], [0.52, -0.17], [0.77, 0.82], [2.16, 1.34], [-0.37, -0.24], [1.1, 0.66], [0.64, -1.62], [-0.02, -0.74], [0.28, -0.1]]), - "cluster_2": np.array([[5.91, 5.32], [5.79, 4.53], [4.06, 4.59], [4.98, 5.38], [7.26, 4.96], [4.04, 4.65], [4.54, 5.48], [3.46, 5.06], [5.16, 5.23], [4.4, 4.76], [3.58, 4.51], [4.46, 5.42], [3.84, 5.78], [6.49, 2.93], [5.43, 5.68]]), - "cluster_3": np.array([[-5.64, 4.6], [-5.13, 4.7], [-5.31, 3.32], [-3.85, 6.08], [-5.81, 3.53], [-4.48, 4.42], [-4.86, 4.68], [-4.31, 5.69], [-5.73, 3.62], [-6.58, 5.61], [-6.19, 4.49], [-5.6, 4.95], [-6.94, 5.19], [-4.48, 5.09], [-5.31, 5.1], [-4.6, 2.23], [-3.04, 5.39], [-5.65, 4.61], [-4.51, 4.88], [-7.03, 7.06]]), - "cluster_4": np.array([[4.89, -3.98], [4.31, -3.46], [5.29, -4.39], [3.95, -3.79], [5.69, -3.7], [4.37, -5.48], [7.3, -6.06], [4.86, -3.86], [5.1, -4.42], [4.6, -4.63], [3.69, -3.34], [4.88, -5.68], [5.67, -5.46], [3.67, -6.35], [5.69, -5.16]]), - "cluster_5": np.array([[-5.13, -3.92], [-6.13, -5.73], [-5.38, -4.91], [-5.04, -5.29], [-5.06, -5.11], [-5.72, -5.81], [-4.73, -5.89], [-6.16, -5.31], [-5.16, -2.74], [-5.7, -4.06]]), - "cluster_6": np.array([[0.75, 8.81], [0.77, 8.82], [-2.66, 10.61], [-1.76, 10.45], [-0.68, 11.66], [1.07, 9.55], [-0.69, 8.79], [-0.44, 9.72], [-0.36, 10.16], [0.58, 10.35], [-0.76, 8.56], [1.36, 9.31], [-0.65, 9.48], [-1.84, 9.52], [-0.48, 10.62], [0.7, 10.], [0.93, 10.34], [-0.02, 10.16], [-0.19, 9.61], [-0.27, 8.87], [0.28, 9.01], [0.84, 9.75], [0.05, 10.49], [0.64, 8.43], [-0.21, 10.88]]), -} - -# Colors for each cluster (replace with actual colors) -colors = { - "cluster_1": "red", - "cluster_2": "blue", - "cluster_3": "green", - "cluster_4": "purple", - "cluster_5": "orange", - "cluster_6": "yellow", -} - -# Variables for plot configuration -xlim = None -ylim = None -xlabel = None -ylabel = None -xticks = None -yticks = None -xtickslabel = None -ytickslabel = None -title = None -axhline = None -axvline = None - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create the scatter plot -plt.figure(figsize=(5, 5)) -for cluster, data in clusters.items(): - plt.scatter(data[:, 0], data[:, 1], c=colors[cluster], alpha=0.5) - -# Remove axes and grid -plt.axis("off") - -# =================== -# Part 4: Saving Output -# =================== -# Show the plot with tight layout to minimize white space -plt.tight_layout() -plt.savefig('scatter_4.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_5.png b/ChartMimic/dataset/ori_500/scatter_5.png deleted file mode 100644 index dfc7b49a9bcb07d235eb1c1b3c1e20f3af7685e1..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_5.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_5.py b/ChartMimic/dataset/ori_500/scatter_5.py deleted file mode 100644 index 34b89ee550438392cfda610ccb616a3986b86c71..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/scatter_5.py +++ /dev/null @@ -1,47 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt - -# =================== -# Part 2: Data Preparation -# =================== -# Data points for each group -siren = [(0.05, 950), (0.10, 800)] -wire = [(0.07, 850), (0.12, 700)] -ffn = [(0.06, 450), (0.11, 400)] -sz3 = [(0.08, 600), (0.13, 550)] -nncomp = [(0.09, 250), (0.14, 200)] -ours = [(0.15, 300), (0.20, 100)] -labels = ["SIREN", "WIRE", "FFN", "SZ3", "NNComp", "Ours"] -xlabel = "Bit per pixel (BPP)" -ylabel = "WRMSE" -title = "Scatter Plot of WRMSE vs BPP" -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a scatter plot -fig, ax = plt.subplots(figsize=(6, 6)) - -# Plot each group with different color and marker -ax.scatter(*zip(*siren), color="blue", label=labels[0]) -ax.scatter(*zip(*wire), color="cyan", label=labels[1]) -ax.scatter(*zip(*ffn), color="red", label=labels[2]) -ax.scatter(*zip(*sz3), color="green", label=labels[3]) -ax.scatter(*zip(*nncomp), color="magenta", label=labels[4], marker="x") -ax.scatter(*zip(*ours), color="orange", label=labels[5]) - -# Add legend -ax.legend(loc="upper right") - -# Add labels and title -ax.set_xlabel(xlabel) -ax.set_ylabel(ylabel) -ax.set_title(title) - -# =================== -# Part 4: Saving Output -# =================== -# Displaying the plot with tight layout to minimize white space -fig.tight_layout() -plt.savefig('scatter_5.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/scatter_6.png b/ChartMimic/dataset/ori_500/scatter_6.png deleted file mode 100644 index 20f95cc33055f42a7065083b8b76ad72739d5413..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_6.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/scatter_7.png b/ChartMimic/dataset/ori_500/scatter_7.png deleted file mode 100644 index aab0f0d3f15cf6126e26eac1e7fd81cf76d2b665..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/scatter_7.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/tree_3.png b/ChartMimic/dataset/ori_500/tree_3.png deleted file mode 100644 index 55519897cc4e0634575e531548903774ffd18f99..0000000000000000000000000000000000000000 Binary files a/ChartMimic/dataset/ori_500/tree_3.png and /dev/null differ diff --git a/ChartMimic/dataset/ori_500/violin_8.py b/ChartMimic/dataset/ori_500/violin_8.py deleted file mode 100644 index 1b7cb22b0bc9628896f80e31d549d92cc70b9431..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/violin_8.py +++ /dev/null @@ -1,124 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Adjusting sample data to fit within 0-1 range and have appropriate shapes -vanilla_data = np.clip( - np.random.normal(0.88, 0.05, 200), 0, 1 -) # Slightly lower std dev, larger sample -cot_data = np.clip(np.random.normal(0.86, 0.05, 200), 0, 1) # Larger sample -extra_data1 = np.clip( - np.random.normal(0.80, 0.12, 200), 0, 1 -) # Slightly lower std dev, larger sample -extra_data2 = np.clip(np.random.normal(0.68, 0.08, 200), 0, 1) # Larger sample -extra_data3 = np.clip(np.random.normal(0.57, 0.1, 200), 0, 1) # Larger sample - -pearson_r = [0.18, 0.19, 0.19, 0.18, 0.16] -eer = [3.33, 3.33, 10.67, 16.95, 29.10] - -data = [vanilla_data, cot_data, extra_data1, extra_data2, extra_data3] -categories = ["Raw", "125Hz", "50Hz", "25Hz", "10Hz"] -ylabel = "KCC" -ylim=[0, 1.06] -xlabel="Decimated Sampling Rate" -textlabels=[ "Pearson R", "EER(%)"] - - - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -fig, ax = plt.subplots( - figsize=(10, 6) -) # Adjust the figure size to accommodate more violins - -# Create violin plots -violin_parts = ax.violinplot(data, showmeans=False, showmedians=True, showextrema=False) - -# Customize the appearance -ax.set_ylabel(ylabel) -ax.set_xticks( - np.arange(1, len(categories) + 1) -) # Adjust the x-ticks to match the number of categories -ax.set_xticklabels(categories) -ax.set_ylim(ylim) # You may need to adjust this if the data range changes -ax.set_xlabel(xlabel) - -# Set violin colors and add statistical annotations -colors = [ - "#44739d", - "#d48640", - "#539045", - "#b14743", - "#8e73ae", -] # Add more colors as needed -for i, (pc, d) in enumerate(zip(violin_parts["bodies"], data)): - pc.set_facecolor(colors[i]) - pc.set_edgecolor("black") - pc.set_alpha(1) - - # Calculate the quartiles and median - quartile1, median, quartile3 = np.percentile(d, [25, 50, 75]) - iqr = quartile3 - quartile1 - - # Calculate whiskers - lower_whisker = np.min(d[d >= quartile1 - 1.5 * iqr]) - upper_whisker = np.max(d[d <= quartile3 + 1.5 * iqr]) - - # Annotate statistics - ax.vlines(i + 1, quartile1, quartile3, color="k", linestyle="-", lw=4) - ax.scatter(i + 1, median, color="w", s=10, zorder=3) - ax.vlines(i + 1, lower_whisker, upper_whisker, color="k", linestyle="-", lw=1) - ax.text( - i + 1 + 0.3, - np.median(data[i]), - f"{median:.2f}", - ha="left", - va="center", - color="black", - rotation=45, - ) - - # Annotate with Pearson R and EER values - ax.text( - i + 1, - 0.14, - f"{pearson_r[i]:.2f}", - ha="center", - va="center", - color="green", - fontsize=10, - ) - ax.text( - i + 1, - 0.08, - f"{eer[i]:.2f}", - ha="center", - va="center", - color="blue", - fontsize=10, - ) - -ax.text(5.6, 0.14,textlabels[0], ha="left", va="center", color="green", fontsize=10) -ax.text(5.6, 0.08,textlabels[1], ha="left", va="center", color="blue", fontsize=10) - -# Make the other parts of the violin plots invisible -for partname in ("cbars", "cmins", "cmaxes", "cmedians"): - vp = violin_parts.get(partname) - if vp: - vp.set_visible(False) - -# =================== -# Part 4: Saving Output -# =================== -# Adjust layout for better fit -plt.tight_layout() - -# Display the plot -plt.savefig('violin_8.pdf', bbox_inches='tight') diff --git a/ChartMimic/dataset/ori_500/violin_9.py b/ChartMimic/dataset/ori_500/violin_9.py deleted file mode 100644 index 839001930cbf443a3a5c3b1a5e3f37df99c10e29..0000000000000000000000000000000000000000 --- a/ChartMimic/dataset/ori_500/violin_9.py +++ /dev/null @@ -1,63 +0,0 @@ -# =================== -# Part 1: Importing Libraries -# =================== -import matplotlib.pyplot as plt -import numpy as np; np.random.seed(0) - - -# =================== -# Part 2: Data Preparation -# =================== -# Generate sample data -class_grades = { - "Class 1": { - "Boys": np.random.normal(70, 10, 100), - "Girls": np.random.normal(75, 12, 100), - }, - "Class 2": { - "Boys": np.random.normal(65, 15, 100), - "Girls": np.random.normal(70, 10, 100), - }, - "Class 3": { - "Boys": np.random.normal(80, 14, 100), - "Girls": np.random.normal(78, 10, 100), - }, - "Class 4": { - "Boys": np.random.normal(75, 9, 100), - "Girls": np.random.normal(80, 13, 100), - }, -} -title="Distribution of Grades:" -xticklabels=["Boys", "Girls"] -xticks=[1, 2] - - - -# Prepare data for violin plot -data_to_plot = [] -for class_name, genders in class_grades.items(): - data_to_plot.extend([grades for gender, grades in genders.items()]) - -# =================== -# Part 3: Plot Configuration and Rendering -# =================== -# Create a figure and an array of axes: 2x2 subplot grid -fig, axs = plt.subplots(nrows=2, ncols=2, figsize=(12, 8)) - -# Flatten the axes array for easy iteration -axs = axs.flatten() - -for i, (class_name, ax) in enumerate(zip(class_grades, axs)): - gender_grades = class_grades[class_name] - ax.violinplot([gender_grades["Boys"], gender_grades["Girls"]]) - ax.set_title(f"{title} {class_name}") - ax.set_xticks(xticks) - ax.set_xticklabels(xticklabels) - -# =================== -# Part 4: Saving Output -# =================== -# Improve spacing between subplots -plt.tight_layout() - -plt.savefig('violin_9.pdf', bbox_inches='tight')