Spaces:
Build error
Build error
Upload 58 files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- ChartMimic/dataset/ori_500/CB_18.pngAdded
- ChartMimic/dataset/ori_500/CB_18.pyAdded+62
- ChartMimic/dataset/ori_500/CB_19.pngAdded
- ChartMimic/dataset/ori_500/CB_19.pyAdded+78
- ChartMimic/dataset/ori_500/CB_23.pngAdded
- ChartMimic/dataset/ori_500/CB_23.pyAdded+95
- ChartMimic/dataset/ori_500/bar_100.pngAdded
- ChartMimic/dataset/ori_500/bar_100.pyAdded+48
- ChartMimic/dataset/ori_500/bar_78.pngAdded
- ChartMimic/dataset/ori_500/bar_78.pyAdded+82
- ChartMimic/dataset/ori_500/bar_80.pngAdded
- ChartMimic/dataset/ori_500/bar_80.pyAdded+97
- ChartMimic/dataset/ori_500/bar_82.pngAdded
- ChartMimic/dataset/ori_500/bar_82.pyAdded+53
- ChartMimic/dataset/ori_500/bar_83.pngAdded
- ChartMimic/dataset/ori_500/bar_83.pyAdded+55
- ChartMimic/dataset/ori_500/bar_85.pngAdded
- ChartMimic/dataset/ori_500/bar_85.pyAdded+118
- ChartMimic/dataset/ori_500/bar_89.pngAdded
- ChartMimic/dataset/ori_500/bar_89.pyAdded+53
- ChartMimic/dataset/ori_500/bar_90.pngAdded
- ChartMimic/dataset/ori_500/bar_90.pyAdded+82
- ChartMimic/dataset/ori_500/bar_91.pngAdded
- ChartMimic/dataset/ori_500/bar_91.pyAdded+111
- ChartMimic/dataset/ori_500/bar_98.pngAdded
- ChartMimic/dataset/ori_500/bar_98.pyAdded+91
- ChartMimic/dataset/ori_500/bar_99.pngAdded
- ChartMimic/dataset/ori_500/bar_99.pyAdded+68
- ChartMimic/dataset/ori_500/box_10.pngAdded
- ChartMimic/dataset/ori_500/box_10.pyAdded+68
- ChartMimic/dataset/ori_500/box_12.pngAdded
- ChartMimic/dataset/ori_500/box_12.pyAdded+55
- ChartMimic/dataset/ori_500/box_13.pngAdded
- ChartMimic/dataset/ori_500/box_13.pyAdded+64
- ChartMimic/dataset/ori_500/box_14.pngAdded
- ChartMimic/dataset/ori_500/box_14.pyAdded+92
- ChartMimic/dataset/ori_500/box_15.pngAdded
- ChartMimic/dataset/ori_500/box_15.pyAdded+49
- ChartMimic/dataset/ori_500/box_16.pngAdded
- ChartMimic/dataset/ori_500/box_16.pyAdded+58
- ChartMimic/dataset/ori_500/box_17.pngAdded
- ChartMimic/dataset/ori_500/box_17.pyAdded+60
- ChartMimic/dataset/ori_500/box_2.pngAdded
- ChartMimic/dataset/ori_500/box_2.pyAdded+88
- ChartMimic/dataset/ori_500/box_20.pngAdded
- ChartMimic/dataset/ori_500/box_20.pyAdded+86
- ChartMimic/dataset/ori_500/box_21.pngAdded
- ChartMimic/dataset/ori_500/box_21.pyAdded+70
- ChartMimic/dataset/ori_500/box_22.pngAdded
- ChartMimic/dataset/ori_500/box_22.pyAdded+59
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datafew_shot_k = np.array([4, 8, 12, 16, 20, 24, 28, 32])trained_w_few_shot_ex = np.array([83, 88, 90, 92, 93, 94, 94.5, 95])def_deduce_ex_gen = np.array([90])error = np.array([1])
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots(figsize=(6, 4)) # Adjusting figure size to 432x288 pixels
# Trained with Few-Shot Examplesax.plot( few_shot_k, trained_w_few_shot_ex, marker="o", color="blue", label="Trained w Few-Shot Ex",)ax.fill_between( few_shot_k, trained_w_few_shot_ex - 1, trained_w_few_shot_ex + 1, color="#e1eff4")
# Default Deduce + Example Generation set theax.errorbar( few_shot_k[0], def_deduce_ex_gen, yerr=error, fmt="o", color="red", label="Def Deduce+Ex Gen", capsize=3,)
# Customizing the plotax.set_xlabel("Few-Shot K")ax.set_ylabel("Micro F1")ax.set_xlim(2, 34)ax.set_ylim(82, 96) # Adjusted y-axis limit to match the reference pictureax.legend(loc="lower right")ax.grid(True)ax.set_xticks([4, 8, 12, 16, 20, 24, 28, 32])
# ===================# Part 4: Saving Output# ===================# Show plotplt.tight_layout()plt.savefig("CB_18.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Datavehicle_trainable_parameter_size = [5, 15, 25, 35, 45]efficiency_7b = [60, 62, 65, 70, 75]vehicle_type_size = [50]efficiency_13b = [80]models_7b = ["Car A", "Car B", "Car C", "Car D", "Car E"]models_13b = ["Truck A"]labels = ["Cars", "Trucks"]ylabel = "Efficiency (%)"xlabel = "Vehicle Parameter Size (units)"# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots( figsize=(7, 7)) # Adjusting figure size to match original dimensionsax.plot( vehicle_trainable_parameter_size, efficiency_7b, "o-r", label=labels[0], marker="o", markersize=5,)ax.plot( vehicle_type_size, efficiency_13b, "o-b", label=labels[1], marker="*", markersize=10,)
# Annotating data pointsfor i, txt in enumerate(models_7b): ax.annotate( f"{efficiency_7b[i]}\n{txt}", (vehicle_trainable_parameter_size[i], efficiency_7b[i]), textcoords="offset points", xytext=(0, 10), ha="center", )
for i, txt in enumerate(models_13b): ax.annotate( f"{efficiency_13b[i]}\n{txt}", (vehicle_type_size[i], efficiency_13b[i]), textcoords="offset points", xytext=(0, 10), ha="center", )
# Legendax.legend(loc="lower right")
# Labels and Titleax.set_ylabel(ylabel)ax.set_xlabel(xlabel)# ax.set_title('Vehicle Performance by Parameter Size')ax.set_yticks([50, 55, 60, 65, 70, 75, 80, 85])ax.set_ylim([48, 85])ax.set_xlim([-5, 55])
# ===================# Part 4: Saving Output# ===================# Show plotplt.tight_layout()plt.savefig("CB_19.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for plottingx = [10, 20, 30, 50, 155]y = [1.30, 1.21, 1.27, 1.28, 1.29]x2 = [50]y2 = [1.19]
# Labels and Plot Typeslabel_Llama_2_7B = "Llama 2 7B"label_Llama_2_13B = "Llama 2 13B"ax1_txt = [ "1.30\nLlaSMol Lite", "1.21\nLlaSMol Attn", "1.27\nLlaSMol FFN", "1.28\nLlaSMol", "1.29\nLlaSMol Plus",]ax2_txt = "1.19\nLlaSMol Large"
# Axes Limits and Labelsxlabel_value = "Trainable Parameter Size (M)"ylabel_value = "RMSE"xticklabels1 = [str(num) for num in x]ylim_values = [1.15, 1.35]yticks_values = [ 1.15, 1.20, 1.25, 1.30,]xlim_values = [-10, 170]xticks_values = [0, 50, 100, 150]xticklabels2 = ["0", "50", "100", "150"]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the figure and axisfig, ax = plt.subplots( figsize=(6, 8)) # Adjust the size to match the original image's dimensions
# Plot the dataax.plot(x, y, "ro-", label=label_Llama_2_7B, linewidth=2)ax.plot(x2, y2, "b*", markersize=10, label=label_Llama_2_13B)
# Annotate the pointsfor i, txt in enumerate(ax1_txt): ax.annotate( txt, (x[i], y[i]), textcoords="offset points", xytext=(0, 5), ha="center", fontsize=10, )ax.annotate( ax2_txt, (x2[0], y2[0]), textcoords="offset points", xytext=(0, 5), ha="center", color="black", fontsize=10,)
# Set labels and titleax.set_xlabel(xlabel_value, fontsize=10)ax.set_ylabel(ylabel_value, fontsize=10)
# Set the legendlegend = ax.legend(fontsize=10)
# Adjust x-axis labelsax.set_xticks(x)ax.set_xticklabels(xticklabels1, ha="center")ax.set_ylim(ylim_values)ax.set_yticks(yticks_values)ax.set_xlim(xlim_values)ax.set_xticks(xticks_values)ax.set_xticklabels(xticklabels2, ha="center")
# ===================# Part 4: Saving Output# ===================# Show the plot with tight layoutplt.tight_layout()plt.savefig("CB_23.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Generate random data for the bars representing average monthly salesdata = np.random.rand(3, 5) * 100 # Three regions, five productsproducts = ["Product A", "Product B", "Product C", "Product D", "Product E"]suptitle = "Average Monthly Sales by Product Across Regions"# Define colors for the bars (one for each region for clarity)colors = ["#7CAE00", "#00BFC4", "#F8766D"]ylim = [0, 100]titles = [f"Region {i+1} Sales" for i in range(3)]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a single figure with 1x3 subplots for each regionfig, axs = plt.subplots(1, 3, figsize=(15, 5))
# Loop over each subplot and add bar charts for each regionfor i, ax in enumerate(axs.ravel()): ax.bar(products, data[i], color=colors[i]) ax.set_title(titles[i]) ax.set_ylim(ylim) # Set a common y-axis limit for comparability
# Optionally, add a grid and customize further ax.grid(True, which="both", axis="y", linestyle="--", alpha=0.7)
# Add an overall title and labelsfig.suptitle(suptitle)plt.setp(axs, xticks=np.arange(len(products)), xticklabels=products)
# ===================# Part 4: Saving Output# ===================# Adjust the layoutfig.tight_layout(rect=[0, 0.03, 1, 0.95]) # Adjust top to accommodate suptitle
# Show and save the plotplt.savefig("bar_100.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Data points representing pollution emission levels in four regionsx = np.arange(4) # X-axis points represent different regionsy1 = np.array([-190, -150, -180, -160]) # Pollution levels for 2020y2 = np.array([-180, -140, -170, -150]) # Pollution levels for 2021labels = ["2020 Emissions", "2021 Emissions"]xticklabels = ["Region 1", "Region 2", "Region 3", "Region 4"]title = "Annual Pollution Emission Reductions"ylim1 = [-220, 0]ylim2 = [-220, 0]
# ===================# Part 3: Plot Configuration and Rendering# ===================fig, ax1 = plt.subplots(figsize=(10, 5))width = 0.4 # Width of the bars
# Plotting data for the year 2020ax1.bar( x, y1, color="#d87769", hatch="/", width=width, label=labels[0], edgecolor="black",)
# Create a second y-axis sharing the same x-axisax2 = ax1.twinx()ax2.bar( x + width, y2, color="#7da1c7", hatch="\\", width=width, label=labels[1], edgecolor="black",)
# Set the x-ticks to be in the middle of the two bars and add labels for the regionsax1.set_xticks(x + width / 2)ax1.set_xticklabels(["Region 1", "Region 2", "Region 3", "Region 4"])
# Adding legends to the plotax1.legend(loc="lower left")ax2.legend(loc="lower right")
# Labeling y-axesax1.set_ylabel(labels[0], color="#d26252")ax2.set_ylabel(labels[1], color="#3f81bb")
# Setting colors for y-axisax1.tick_params(axis="y", colors="#d26252")ax2.tick_params(axis="y", colors="#3f81bb")
# Setting the limits for y-axesax1.set_ylim(ylim1)ax2.set_ylim(ylim2)
# Title for the chartplt.title(title)
# ===================# Part 4: Saving Output# ===================# Layout adjustment to prevent clippingplt.tight_layout()
# Saving the plot as a PDFplt.savefig("bar_78.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Example datagroups = ["3", "5", "7", "10"]llama_default = [-1, -1.5, -2, -2.5]llama_hag = [0.5, -0.5, 1, -1.5]vicuna_default = [-0.5, -1, -1.5, -2]vicuna_hag = [0.5, 0, 1, -1]
# Reduce the number of negative bars to two per group,# for the sake of the example, I'll keep the first and third bar negative and make the rest positive.llama_default = [1, 1.5, -2, 2.5]llama_hag = [0.5, 0.5, -1, 1.5]vicuna_default = [0.5, 1, -1.5, 2]vicuna_hag = [0.5, 1, 1, -1]
n_groups = len(groups)
labels = ["LLAMA-Default", "LLAMA-HAG", "Vicuna-Default", "Vicuna-HAG"]xlabel = "Num of Constraint Words"ylabel = "Score"title = "Taboo"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the plotfig, ax = plt.subplots(figsize=(10, 5))
index = np.arange(n_groups)bar_width = 0.2
opacity = 0.8
rects1 = ax.bar( index - 1.5 * bar_width, llama_default, bar_width, alpha=opacity, color="#8ECFC9", label=labels[0],)
rects2 = ax.bar( index - 0.5 * bar_width, llama_hag, bar_width, alpha=opacity, color="#FFBE7A", label=labels[1],)
rects3 = ax.bar( index + 0.5 * bar_width, vicuna_default, bar_width, alpha=opacity, color="#82B0D2", label=labels[2],)
rects4 = ax.bar( index + 1.5 * bar_width, vicuna_hag, bar_width, alpha=opacity, color="#E7DAD2", hatch="+", label=labels[3],)
ax.set_xlabel(xlabel)ax.set_ylabel(ylabel)ax.set_title(title)ax.set_xticks(index)ax.set_xticklabels(groups)ax.spines["top"].set_visible(False)ax.spines["right"].set_visible(False)ax.yaxis.grid(True, linestyle="--")plt.legend()
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_80.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport matplotlib.cm as cmimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datacategories = ["Sedan", "SUV", "Truck", "Coupe", "Convertible"]categories2 = ["Sedan New", "SUV New", "Truck New", "Coupe New", "Convertible New"]values = [15, 26, 20, 30, 17]values2 = [10, 15, 20, 21, 23]
# Create color mapcolors = plt.get_cmap("PuBuGn")(np.linspace(0.15, 0.85, len(categories2)))
title = "Probability of Improvement over VLM Image Encoder Baseline Returns"xlabel = "Probability of Improvement"
# ===================# Part 3: Plot Configuration and Rendering# ===================fig, axes = plt.subplots( 2, 1, figsize=(6, 6), layout="constrained",)
# Create horizontal bar chartaxes[0].barh(categories, values, color=colors)axes[1].barh(categories, values2, color=colors)axes[0].set_title(title)
# Apply the xticks and labelsaxes[0].set_yticklabels(categories, rotation=45)axes[1].set_yticklabels(categories2, rotation=45)
# Adding title and labelsplt.xlabel(xlabel)
# ===================# Part 4: Saving Output# ===================# Show plot with tight layoutplt.tight_layout()plt.savefig("bar_82.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Emotion labelsemotions = [ "Amusement", "Unbothered", "Sadness", "Pride", "Nervousness", "Annoyance", "Gratitude", "Relief", "Joy", "Disapproval",]
# Approximate frequency values based on the imagefrequencies = [7.6, 7.0, 6.7, 6.6, 6.0, 6.0, 3.5, 3.5, 3.0, 2.1]frequencies2 = [2.6, 3.0, 3.7, 4.6, 5.0, 5.0, 5.5, 6.5, 7.0, 7.1]xlabel1 = "Frequency Metric 1 (%)"xlabel2 = "Frequency Metric 2 (%)"ylabel = "Emotion"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create horizontal bar chartfig, axes = plt.subplots(1, 2, figsize=(10, 4), layout="constrained", sharey=True)axes[0].barh(emotions, frequencies, color="lightcoral", edgecolor="gray")axes[1].barh(emotions, frequencies2, color="lightblue", edgecolor="gray")
# Adding data labelsfor index, value in enumerate(frequencies): axes[0].text(value, index, f" {value}%", va="center")# Adding data labelsfor index, value in enumerate(frequencies2): axes[1].text(value, index, f" {value}%", va="center")
# Set labels and titleaxes[0].set_xlabel(xlabel1)axes[0].set_ylabel(ylabel)axes[1].set_xlabel(xlabel2)
# ===================# Part 4: Saving Output# ===================# Show the plot with tight layoutplt.tight_layout()plt.savefig("bar_83.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Data reflecting energy statistics for various countries, scaled for better visualizationcategories = ["Germany", "Canada", "Australia", "Japan"][::-1]total_energy_consumption = ( np.array([3450, 2750, 2300, 2900][::-1]) / 10) # in Petajoules, scaled downrenewable_energy_ratio = np.array( [400, 500, 750, 620][::-1]) # percentage of total energyelectricity_production = ( np.array([6000, 7000, 5500, 6400][::-1]) / 10) # in Terawatt-hours, scaled downelectricity_consumption = np.array( [580, 690, 530, 630][::-1]) # in Terawatt-hours, scaled down
categories2 = ["USA", "UK", "France", "Italy"][::-1]total_energy_consumption2 = ( np.array([2300, 1950, 2500, 1750][::-1]) / 10) # in Petajoules, scaled downrenewable_energy_ratio2 = np.array( [550, 450, 530, 690][::-1]) # percentage of total energyelectricity_production2 = ( np.array([4000, 2000, 5700, 3200][::-1]) / 10) # in Terawatt-hours, scaled downelectricity_consumption2 = ( np.array([3900, 880, 5600, 3100][::-1]) / 10) # in Terawatt-hours, scaled down
# ===================# Part 3: Plot Configuration and Rendering# ===================# Stacked Bar Chart in subplotsfig, axs = plt.subplots(2, 1, figsize=(8, 8), sharex=True) # 2 rows, 1 columnbar_width = 0.8y_pos = range(len(categories))y_pos2 = range(len(categories2))
colors = ["tomato", "wheat", "#81acce", "darkseagreen"]labels = [ "Total Energy Consumption (10^2 PJ)", "Renewable Energy Ratio (%)", "Electricity Production (10^1 TWh)", "Electricity Consumption (10^1 TWh)",]data_ratios = [ total_energy_consumption, renewable_energy_ratio, electricity_production, electricity_consumption,]data_ratios2 = [ total_energy_consumption2, renewable_energy_ratio2, electricity_production2, electricity_consumption2,]
axs[0].invert_yaxis() # labels read top-to-bottomaxs[0].set_yticks(y_pos)axs[0].set_yticklabels(categories)axs[0].grid(axis="x", color="gray", linestyle="--", linewidth=0.5)axs[0].set_axisbelow(True)
axs[1].invert_yaxis() # labels read top-to-bottomaxs[1].set_yticks(y_pos2)axs[1].set_yticklabels(categories2)axs[1].grid(axis="x", color="gray", linestyle="--", linewidth=0.5)axs[1].set_axisbelow(True)
# Plot each ratio on separate subplotsfor idx, data_ratio in enumerate(data_ratios[:3]): lefts = np.zeros(len(categories)) for data, color, label in zip(data_ratios, colors, labels): axs[0].barh( y_pos, data, bar_width, left=lefts, color=color, label=label if idx == 0 else "", ) lefts += data
for idx, data_ratio in enumerate(data_ratios2[:3]): lefts = np.zeros(len(categories2)) for data, color, label in zip( data_ratios2, colors, labels ): # Use data_ratios2 here axs[1].barh( y_pos2, data, bar_width, left=lefts, color=color, label=label if idx == 0 else "", ) lefts += datafig.legend(labels, loc="upper center", bbox_to_anchor=(0.5, 1.1), ncol=2)
# ===================# Part 4: Saving Output# ===================# Adjust layout and save the figureplt.tight_layout()plt.savefig("bar_85.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for the bar chartsuperfamilies = 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 chartfig, axes = plt.subplots( 3, 1, figsize=(10, 6), sharex=True) # Adjusting figure size to match the original image's dimensionsaxes[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 accuracyaxes[0].axhline(y=yline, color="red", linestyle="--")
# Add labels and titleplt.xlabel(xlabel)axes[0].set_ylabel(ylabel1)axes[1].set_ylabel(ylabel2)axes[2].set_ylabel(ylabel3)
# Set y-axis limitsplt.ylim(0.0, 1.1)# Set x-axis, y-axis ticksplt.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 spaceplt.tight_layout()plt.savefig("bar_89.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182# ===================# Part 1: Importing Libraries# ===================import colorsysimport numpy as np
np.random.seed(0)
import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Redefining the datamodels = ["Lavila", "Video-LLaMA", "BLIP1", "BLIP2", "LLaVA", "OSCaR", "GPT4V"]percentages = [0.0, 0.71, 4.64, 4.64, 31.79, 73.93, 82.5]percentages2 = [2.0, 3.55, 5.64, 12.64, 18.79, 20.93, 30.5]# Sorting the data in descending order while keeping track of the models ordersorted_data = sorted(zip(percentages, models), reverse=True)sorted_percentages, sorted_models = zip(*sorted_data)
xlabel = "Model"ylabel1 = "Score A (%)"ylabel2 = "Score B (%)"title = "Human Study"
# Generate random colors with lower saturationdef hsl_to_rgb(h, s, l): return colorsys.hls_to_rgb(h, l, s)
# Randomly generate colorscolors = [hsl_to_rgb(hue, 0.5, 0.6) for hue in np.linspace(0, 1, len(models) + 1)[:-1]]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create figure and bar chart with the sorted datafig, axes = plt.subplots(2, 1, figsize=(12, 8), sharex=True)bars = axes[0].bar(sorted_models, sorted_percentages, color=colors)bars2 = axes[1].bar(sorted_models, percentages2, color=colors)# Randomly decide where to put the text based on the value of the barfor bar in bars: yval = bar.get_height() text_y = ( yval - 5 if yval > 10 else yval + 1 ) # Slight modification to avoid negative values axes[0].text( bar.get_x() + bar.get_width() / 2, text_y, f"{yval}%", ha="center", va="top" if text_y < yval else "bottom", )
# Set chart title and labelsplt.xlabel(xlabel)axes[0].set_ylabel(ylabel1)axes[1].set_ylabel(ylabel2)
# Randomly set y-axis range to a bit higher than the max valueaxes[0].set_ylim(0, np.max(sorted_percentages) + 10)axes[1].set_ylim(0, np.max(percentages2) + 10)
# Randomize the gridlines and ticksaxes[1].grid(axis="y", linestyle="--", alpha=0.7)# Hide the top and right spinesaxes[0].spines["top"].set_visible(False)axes[0].spines["right"].set_visible(False)axes[1].spines["top"].set_visible(False)axes[1].spines["right"].set_visible(False)# Randomize tick rotationplt.xticks(rotation=45)fig.suptitle(title)
# ===================# Part 4: Saving Output# ===================# Apply tight layoutplt.tight_layout()plt.savefig("bar_90.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np; np.random.seed(0)
import matplotlib.patches as mpatches
# ===================# Part 2: Data Preparation# ===================# Datalabels = ["GCN", "RvNN", "Hyphen", "GET"]democratic = [ 0.75, 0.8, 0.78, 0.85,]mixed = [ 0.8, 0.85, 0.82, 0.83,]republican = [ 0.84, 0.80, 0.81, 0.8,]
colors = ["#919fc7", "#ed936b", "#c8686d"]legendlabel = ["Democratic", "Mixed", "Republican"]ylabel1 ="Macro F1-score"ylabel2 ="Macro F1-score"xlabel1="Pheme"xlabel2="LLM-mis"ylim1=[0.70, 0.85]ylim2=[0.70, 0.85]yticks1=[0.7, 0.75, 0.80]yticks2=[0.80, 0.85, 0.90]ytickslabel1=[".70", ".75", ".80"]ytickslabel2=[".80", ".85", ".90"]
x = np.arange(len(labels)) # the label locationswidth = 0.25 # the width of the bars
# ===================# Part 3: Plot Configuration and Rendering# ===================fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))
# Upper plotrects1 = ax1.bar( x - width, democratic, width, label=legendlabel[0], color=colors[0], edgecolor="black")rects2 = ax1.bar(x, mixed, width, label=legendlabel[1], color=colors[1], edgecolor="black")rects3 = ax1.bar( x + width, republican, width, label=legendlabel[2], color=colors[2], edgecolor="black")# Lower plotrects4 = ax2.bar(x - width, democratic, width, color=colors[0], edgecolor="black")rects5 = ax2.bar(x, mixed, width, color=colors[1], edgecolor="black")rects6 = ax2.bar(x + width, republican, width, color=colors[2], edgecolor="black")
# Add some text for labels, title and custom x-axis tick labels, etc.ax1.set_ylabel(ylabel1)ax2.set_ylabel(ylabel2)ax1.set_xlabel(xlabel1)ax2.set_xlabel(xlabel2)ax1.set_xticks(x)ax1.set_xticklabels(labels)ax2.set_xticks(x)ax2.set_xticklabels(labels)# Set y-axis limit to match the reference pictureax1.set_ylim(ylim1)ax2.set_ylim(ylim2)
ax1.set_yticks(yticks1)ax1.set_yticklabels(ytickslabel1)ax2.set_yticks(yticks2)ax2.set_yticklabels(ytickslabel2)
# Set grid color and styleax2.grid(axis="y", color="gray", linestyle="--", linewidth=0.5)
ax1.set_axisbelow(True)ax2.set_axisbelow(True)
# Remove top and right bordersax1.spines["top"].set_visible(False)ax1.spines["right"].set_visible(False)ax2.spines["top"].set_visible(False)ax2.spines["right"].set_visible(False)# Add legendlegend_handles = [ mpatches.Patch(color=color, label=label) for color, label in zip(colors, legendlabel)]# Create legendfig.legend( handles=legend_handles, loc="upper center", ncol=3, bbox_to_anchor=(0.5, 1.15))
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig('bar_91.pdf', bbox_inches='tight')12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datalabels = [ "Model A", "Model B", "Model C", "Model D", "Model E", "Model F", "Model G", "Model H", "Model I",]non_aggregation = np.random.rand(9) * 100aggregation = 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 locationswidth = 0.35 # the width of the bars
legendtitle = "Methods"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots(figsize=(10, 6)) # Adjust the size accordinglyrects1 = 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 barsfor 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 gridax.grid(axis="y", color="gray", linestyle="--", linewidth=0.7, alpha=0.7)ax.set_axisbelow(True)
# Hide the ticksax.tick_params(axis="both", which="both", length=0)
# Hide the right and top spinesax.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")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Create traffic datadata = 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 subplotdef 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 subplotfor i, ax in enumerate(axs.flat): plot_bars(ax, data[i], categories, colors[i], titles[i])
# ===================# Part 4: Saving Output# ===================# Adjust layout to prevent overlapfig.tight_layout()plt.savefig("bar_99.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data for the boxplotsdata = { "Music Playtime": np.random.uniform(30, 90, 20), "Reading Duration": np.random.uniform(25, 75, 20), "Exercise Duration": np.random.uniform(20, 70, 20), "Gaming Duration": np.random.uniform(15, 65, 20),}xlabel = "Duration (minutes)"title = "Daily Activity Durations"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a figure and axis with the specified sizefig, ax = plt.subplots(figsize=(9, 5))
# Create the boxplots with specific colorsboxprops = dict(linestyle="-", linewidth=2, color="darkblue")flierprops = dict(marker="D", color="red", markerfacecolor="red", markersize=5)medianprops = dict(linestyle="-", linewidth=2, color="green")
# Boxplot with vertical orientationbp = ax.boxplot( data.values(), vert=False, patch_artist=True, boxprops=boxprops, flierprops=flierprops, medianprops=medianprops,)
colors = ["lightblue", "lightgreen", "lightyellow", "lightgray"]for patch, color in zip(bp["boxes"], colors): patch.set_facecolor(color) # Scatter plot for data points for j, key in enumerate(data.keys()): x = data[key] y = np.random.normal(j + 1, 0.02, size=len(x)) plt.plot(x, y, "k.", alpha=0.4, color="#4e8a84")
# Set the x-axis labels with data keysax.set_yticklabels(data.keys(), ha="right")
# Set the y-axis labelax.set_xlabel(xlabel)ax.xaxis.grid(False)ax.xaxis.grid(True)
# Set the title of the plotax.set_title(title)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_10.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Sample data for the boxplots (actual data not provided in the question)data = [ [4.2, 4.5, 4.8, 4.9, 5.0], [4.0, 4.3, 4.6, 4.7, 4.8], [3.0, 3.5, 4.0, 4.5, 5.0], [3.2, 3.6, 4.1, 4.6, 5.1], [3.4, 3.8, 4.2, 4.7, 5.2],]
# Category names for the x-axiscategories = [ "AlphaBeta", "${z^+}$", "Gamma(γ = 0.05)", "Gamma(γ = 0.1)", "Gamma(γ = 0.25)",]
# Axes Limits and Labelsxticks_values = range(1, len(categories) + 1)ylim_values = [2, 6.5]yticks_values = [2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0]yticks_label = ["2.5", "3.0", "3.5", "4.0", "4.5", "5.0", "5.5", "6.0"]ylabel_value = "${(↑)∆A^F}$"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the boxplotplt.figure(figsize=(8, 6)) # Size in inches (converted from provided dimensions)plt.boxplot(data, medianprops=dict(color="orange"))
# Set the x-axis labelsplt.xticks(xticks_values, categories)plt.ylim(ylim_values)plt.yticks( yticks_values, yticks_label,)# Set the y-axis labelplt.ylabel(ylabel_value)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_12.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data to mimic the boxplot in the picturedata = [ 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 boxplotfig, ax = plt.subplots( figsize=(6, 5)) # Adjusting figure size as per the dimensions providedbp = 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 outliersfor flier in bp["fliers"]: flier.set(marker="", color="black")
# Set the y-axis range and tick labelsax.set_ylim(ylim)ax.set_yticks(yticks)# Set the y-axis labelax.set_ylabel(ylabel, fontsize=12)
# Set the tick label sizeax.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 spaceplt.tight_layout()plt.savefig("box_13.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data for demonstration purposesaccuracy = [ np.random.normal(0.88, 0.04, 100), np.random.normal(0.87, 0.05, 100), np.random.normal(0.83, 0.03, 100),]error = [ np.random.normal(7.26, 1.5, 100), np.random.normal(9.27, 2, 100), np.random.normal(9.48, 2.5, 100),]
titles = ["Region Classification Accuracy", "Slice Mean Error (ms)"]xticklabels = ["DENSE (ref)", "Joint Multimodal\nFramework\n (ours)", "Cine"]ylabels = ["LMA Region Classification Accuracy", "Slice Mean Error (ms)"]yticks = [np.arange(0.6, 1.1, 0.1), np.arange(2.5, 22.6, 2.5)]ylims = [[0.5, 1], [2.4, 22.6]]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create figure and subplots with specified figure sizefig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))medianprops = dict(linestyle="-", linewidth=1, color="black")# Left subplot - Region Classification Accuracybplot1 = ax1.boxplot( accuracy, patch_artist=True, showfliers=True, widths=0.6, medianprops=medianprops, flierprops=dict(marker="D", color="black", markerfacecolor="black", markersize=5),)ax1.set_title(titles[0])ax1.set_xticklabels(xticklabels)ax1.set_ylabel(ylabels[0])ax1.set_yticks(yticks[0])ax1.set_ylim(ylims[0])ax1.set_facecolor("#eaeaf2")ax1.yaxis.grid(True, color="white")
# Add median value annotationsfor i, line in enumerate(bplot1["medians"]): x, y = line.get_xydata()[1] ax1.text(x - 0.3, y, f"{y:.2f}", horizontalalignment="center", color="black")
# Right subplot - Slice Mean Errorbplot2 = ax2.boxplot( error, patch_artist=True, showfliers=True, widths=0.6, medianprops=medianprops, flierprops=dict(marker="D", color="black", markerfacecolor="black", markersize=5),)ax2.set_title(titles[1])ax2.set_xticklabels(xticklabels)ax2.set_ylabel(ylabels[1])ax2.set_yticks(yticks[1])ax2.set_ylim(ylims[1])ax2.set_facecolor("#eaeaf2")ax2.yaxis.grid(True, color="white")
# Add median value annotationsfor i, line in enumerate(bplot2["medians"]): x, y = line.get_xydata()[1] ax2.text(x - 0.3, y, f"{y:.2f}", horizontalalignment="center", color="black")
# Set colors for boxplotscolors = ["#5e74a0", "#c38c6a", "#6e9d72"]for bplot in (bplot1, bplot2): for patch, color in zip(bplot["boxes"], colors): patch.set_facecolor(color)
# ===================# Part 4: Saving Output# ===================# Adjust layout to prevent overlapplt.tight_layout()plt.savefig("box_14.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data for demonstration purposescenter = np.random.randint(0, 12, 5)data = [np.random.normal(center[std - 1], std, 100) for std in range(1, 6)]xticklabels = ["w/o att", "w/o DP", "1xQ", "20xQ", "200xQ"]ylabel = "Z-Score"xhline = 5# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a figure with the specified dimensionsfig, ax = plt.subplots(figsize=(8, 5))
medianprops = dict(linestyle="-", linewidth=1, color="black")# Boxplot with custom colorsbox = ax.boxplot(data, patch_artist=True, medianprops=medianprops)colors = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd"]for patch, color in zip(box["boxes"], colors): patch.set_facecolor(color)
# Add threshold lineax.axhline(xhline, color="r", linestyle="--", label="threshold")
# Set x-axis labelsax.set_xticklabels(xticklabels)
# Set y-axis labelax.set_ylabel(ylabel)
# Add legend for the threshold lineax.legend(loc="upper right", frameon=False)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("box_15.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data (replace with actual values from the image)data = { "Mean": np.random.rand(6, 6) * 1.5 + 1.5,}
labels = [ "C w/o action inputs", "No latent space C", "4 x 4 tokenizer", "Separate M emb.", "No POP", "REM",]xlim = [1, 3]
# ===================# Part 3: Plot Configuration and Rendering# ===================fig, ax = plt.subplots(figsize=(5, 5), constrained_layout=True)colors = ["#d1af8e", "#d09dca", "#d48b4f", "#65b598", "#5894c2", "#deae57"]bplot = ax.boxplot( data["Mean"], vert=False, patch_artist=True, showcaps=False, showfliers=False, whiskerprops=dict(color="black", linestyle="-", linewidth=0), medianprops={"color": "black"}, boxprops=dict(linestyle="-", linewidth=0),)for patch, color in zip(bplot["boxes"], colors): patch.set_facecolor(color)ax.set_title(list(data.keys())[0])ax.set_yticklabels(labels)ax.set_xlim(xlim)ax.spines["top"].set_visible(False)ax.spines["right"].set_visible(False)ax.spines["left"].set_visible(False)ax.xaxis.grid(True, alpha=0.7)ax.set_axisbelow(True)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_16.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Random data to simulate the boxplotdata = [np.random.normal(60, 20, 100) for _ in range(10)]xticklabels = [f"Run {i+1}" for i in range(10)]ylabel = "Value"# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the boxplotfig, ax = plt.subplots( figsize=(8, 4)) # Adjust the figure size to match the original image's dimensionsboxprops = dict(linestyle="-", linewidth=2, color="blue")medianprops = dict(linestyle="-", linewidth=2, color="orange")meanprops = dict(marker=None) # Hide mean points
bp = ax.boxplot( data, patch_artist=True, showmeans=True, meanprops=meanprops, showfliers=False, boxprops=boxprops, medianprops=medianprops,)
for patch in bp["boxes"]: patch.set(facecolor="lightblue")
# Set the x-axis labelsax.set_xticklabels(xticklabels, rotation=0)
# Set the y-axis labelax.set_ylabel(ylabel)
# Add markers for minimum valuesfor i, line in enumerate(bp["whiskers"][::2]): mid_val = (line.get_ydata()[0] + line.get_ydata()[1]) / 2 + line.get_ydata()[ 1 ] # Get the y value of the minimum whisker ax.plot( i + 1, mid_val, marker="o", color="red" ) # Add a marker at the minimum value
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_17.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data for demonstration purposesratings_data = [np.random.normal(2.6, 0.1, 100), np.random.normal(2.4, 0.1, 100)]intrusion_data = [np.random.normal(0.75, 0.05, 100), np.random.normal(0.7, 0.05, 100)]
title_1 = "Ratings"title_2 = "Intrusion"xticklabels = ["Our Model", "NTM+CL"]# ===================# Part 3: Plot Configuration and Rendering# ===================# Set the figure size to match the original image's dimensionsplt.figure(figsize=(8, 6))
# Create subplotsfig, axs = plt.subplots(2, 2)
# Plot the boxplotsbp1 = axs[0, 0].boxplot( ratings_data, patch_artist=True, widths=0.5, showfliers=False, medianprops=dict(color="black"),)bp2 = axs[0, 1].boxplot( intrusion_data, patch_artist=True, widths=0.5, showfliers=False, medianprops=dict(color="black"),)bp3 = axs[1, 0].boxplot( ratings_data, patch_artist=True, widths=0.5, showfliers=False, medianprops=dict(color="black"),)bp4 = axs[1, 1].boxplot( intrusion_data, patch_artist=True, widths=0.5, showfliers=False, medianprops=dict(color="black"),)
# Set the colors of the boxesbp1["boxes"][0].set_facecolor("#d98694")bp1["boxes"][1].set_facecolor("#5d9c97")bp2["boxes"][0].set_facecolor("#d98694")bp2["boxes"][1].set_facecolor("#5d9c97")bp3["boxes"][0].set_facecolor("#d98694")bp3["boxes"][1].set_facecolor("#5d9c97")bp4["boxes"][0].set_facecolor("#d98694")bp4["boxes"][1].set_facecolor("#5d9c97")
# Set titles and labelsaxs[0, 0].set_title(title_1)axs[0, 0].grid("both")axs[0, 1].set_title(title_2)axs[0, 1].grid("both")axs[0, 0].set_xticklabels(xticklabels)axs[0, 1].set_xticklabels(xticklabels)axs[1, 0].set_title(title_1)axs[1, 0].grid("both")axs[1, 1].set_title(title_2)axs[1, 1].grid("both")axs[1, 0].set_xticklabels(xticklabels)axs[1, 1].set_xticklabels(xticklabels)
# ===================# Part 4: Saving Output# ===================# Adjust layout and save the figureplt.tight_layout()plt.savefig("box_2.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Placeholder data for the boxplotsdata1 = [np.random.normal(6, 1, 100), np.random.normal(5, 1, 100)]data2 = [np.random.normal(1.5, 0.2, 100), np.random.normal(1, 0.2, 100)]data3 = [np.random.normal(0.8, 0.1, 100), np.random.normal(0.9, 0.05, 100)]data4 = [np.random.normal(0.8, 0.1, 100), np.random.normal(0.6, 0.1, 100)]data5 = [np.random.normal(1.5, 0.3, 100), np.random.normal(1, 0.3, 100)]titles = [ "Digit span", "Lexical decision", "Lexical decision", "Reaction time", "Trail making",]xticklabels = ["target", "control"]xticks = [1, 2]xlabel = "Group"ylabels = ( "Longest correct sequence", "Correct word reaction time [s]", "Correct response ratio", "Reaction time [s]", "Time per tap [s]",)
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a figure with custom dimensions to match the original imagefig, axs = plt.subplots(1, 5, figsize=(10, 5)) # Adjusted for clarity
# Define colors for the boxplotscolors = ["#1f77b4", "#ff7f0e"]
# Plot the boxplots with the specified colors and outlier shapesfor i, data in enumerate([data1, data2, data3, data4, data5]): bplot = axs[i].boxplot( data, patch_artist=True, notch=False, widths=0.7, medianprops=dict(color="black"), flierprops=dict( marker="D", color="black", markerfacecolor="black", markersize=5 ), ) for patch, color in zip(bplot["boxes"], colors): patch.set_facecolor(color)
# Set the titles for each subplotaxs[0].set_title(titles[0])axs[1].set_title(titles[1])axs[2].set_title(titles[2])axs[3].set_title(titles[3])axs[4].set_title(titles[4])
# Set the x-axis labels with proper spacingfor ax in axs: ax.set_xticks(xticks) ax.set_xticklabels(xticklabels) ax.set_xlabel(xlabel)
# Set the y-axis labelsaxs[0].set_ylabel(ylabels[0])axs[1].set_ylabel(ylabels[1])axs[2].set_ylabel(ylabels[2])axs[3].set_ylabel(ylabels[3])axs[4].set_ylabel(ylabels[4])
# ===================# Part 4: Saving Output# ===================# Adjust the layout and save the figureplt.tight_layout()plt.savefig("box_20.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Sample data for the boxplotsdata = { "BG": np.random.uniform(60, 95, 100), "IBP": np.random.uniform(70, 90, 100), "SSP": np.random.uniform(50, 85, 100), "NBP": np.random.uniform(40, 80, 100),}
# Reverse the order of data for boxplotsdata_values = list(data.values())[::-1]data_keys = list(data.keys())[::-1]xlabel = "Prediction Accuracy $\\nu_{D_1}$"xlim = [0, 100]xticks = np.arange(0, 101, 20)title = "Methods"# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a figure and axis with the specified sizefig, ax = plt.subplots(figsize=(9, 5))
# Create the boxplots with specific colorsboxprops = dict(linestyle="-", linewidth=2, color="black")flierprops = dict(marker="o", color="black", markersize=5)medianprops = dict(linestyle="-", linewidth=2, color="black")
bp = ax.boxplot( data_values, vert=False, patch_artist=True, boxprops=boxprops, flierprops=flierprops, medianprops=medianprops,)
colors = ["#824920", "#377e22", "#0000f5", "#75147c"][::-1]for patch, color in zip(bp["boxes"], colors): patch.set_facecolor(color)
# Set the y-axis labels with reversed orderax.set_yticklabels(data_keys)
# Set the x-axis labelax.set_xlabel(xlabel)
# Set the x-axis limits and ticksax.set_xlim(xlim)ax.set_xticks(xticks)ax.set_xticklabels(["{}%".format(i) for i in xticks])
# Set the title of the plotax.set_title(title)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_21.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================data = [ np.random.normal(0.0, 0.05, 100), np.random.normal(0.005, 0.06, 100), np.random.normal(0.015, 0.03, 100), np.random.normal(0.03, 0.035, 100), np.random.normal(0.028, 0.05, 100),]
labels = ["50", "100", "150", "200", "350"]
# Axes Limits and Labelsylim_values = [-0.06, 0.06]xlabel_value = "Search depth"ylabel_value = "Reward"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the boxplotfig, ax = plt.subplots( figsize=(6, 5)) # Adjusting figure size as per the dimensions providedbp = ax.boxplot( data, labels=labels, patch_artist=True, boxprops=dict(facecolor="#3171ad", color="black"), showfliers=False, showcaps=False, medianprops=dict(color="black"), whiskerprops=dict(color="black", linestyle="-", linewidth=0), capprops=dict(color="black", linestyle="-"),)
ax.set_ylim(ylim_values)# Set labelsax.set_xlabel(xlabel_value)ax.set_ylabel(ylabel_value)
# Set gridax.grid(True)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("box_22.pdf", bbox_inches="tight")ChartMimic/dataset/ori_500/CB_18.pngAdded

ChartMimic/dataset/ori_500/CB_18.pyAdded+62
ChartMimic/dataset/ori_500/CB_19.pngAdded

ChartMimic/dataset/ori_500/CB_19.pyAdded+78
ChartMimic/dataset/ori_500/CB_23.pngAdded

ChartMimic/dataset/ori_500/CB_23.pyAdded+95
ChartMimic/dataset/ori_500/bar_100.pngAdded

ChartMimic/dataset/ori_500/bar_100.pyAdded+48
ChartMimic/dataset/ori_500/bar_78.pngAdded

ChartMimic/dataset/ori_500/bar_78.pyAdded+82
ChartMimic/dataset/ori_500/bar_80.pngAdded

ChartMimic/dataset/ori_500/bar_80.pyAdded+97
ChartMimic/dataset/ori_500/bar_82.pngAdded

ChartMimic/dataset/ori_500/bar_82.pyAdded+53
ChartMimic/dataset/ori_500/bar_83.pngAdded

ChartMimic/dataset/ori_500/bar_83.pyAdded+55
ChartMimic/dataset/ori_500/bar_85.pngAdded

ChartMimic/dataset/ori_500/bar_85.pyAdded+118
ChartMimic/dataset/ori_500/bar_89.pngAdded

ChartMimic/dataset/ori_500/bar_89.pyAdded+53
ChartMimic/dataset/ori_500/bar_90.pngAdded

ChartMimic/dataset/ori_500/bar_90.pyAdded+82
ChartMimic/dataset/ori_500/bar_91.pngAdded

ChartMimic/dataset/ori_500/bar_91.pyAdded+111
ChartMimic/dataset/ori_500/bar_98.pngAdded

ChartMimic/dataset/ori_500/bar_98.pyAdded+91
ChartMimic/dataset/ori_500/bar_99.pngAdded

ChartMimic/dataset/ori_500/bar_99.pyAdded+68
ChartMimic/dataset/ori_500/box_10.pngAdded

ChartMimic/dataset/ori_500/box_10.pyAdded+68
ChartMimic/dataset/ori_500/box_12.pngAdded

ChartMimic/dataset/ori_500/box_12.pyAdded+55
ChartMimic/dataset/ori_500/box_13.pngAdded

ChartMimic/dataset/ori_500/box_13.pyAdded+64
ChartMimic/dataset/ori_500/box_14.pngAdded

ChartMimic/dataset/ori_500/box_14.pyAdded+92
ChartMimic/dataset/ori_500/box_15.pngAdded

ChartMimic/dataset/ori_500/box_15.pyAdded+49
ChartMimic/dataset/ori_500/box_16.pngAdded

ChartMimic/dataset/ori_500/box_16.pyAdded+58
ChartMimic/dataset/ori_500/box_17.pngAdded

ChartMimic/dataset/ori_500/box_17.pyAdded+60
ChartMimic/dataset/ori_500/box_2.pngAdded

ChartMimic/dataset/ori_500/box_2.pyAdded+88
ChartMimic/dataset/ori_500/box_20.pngAdded

ChartMimic/dataset/ori_500/box_20.pyAdded+86
ChartMimic/dataset/ori_500/box_21.pngAdded

ChartMimic/dataset/ori_500/box_21.pyAdded+70
ChartMimic/dataset/ori_500/box_22.pngAdded

ChartMimic/dataset/ori_500/box_22.pyAdded+59