Spaces:
Build error
Build error
Upload 51 files
Browse filesFiles changed (50)
- ChartMimic/dataset/ori_500/3d_10.pngAdded
- ChartMimic/dataset/ori_500/3d_10.pyAdded+65
- ChartMimic/dataset/ori_500/3d_9.pngAdded
- ChartMimic/dataset/ori_500/3d_9.pyAdded+41
- ChartMimic/dataset/ori_500/area_1.pngAdded
- ChartMimic/dataset/ori_500/area_1.pyAdded+116
- ChartMimic/dataset/ori_500/area_3.pngAdded
- ChartMimic/dataset/ori_500/area_3.pyAdded+104
- ChartMimic/dataset/ori_500/area_4.pngAdded
- ChartMimic/dataset/ori_500/area_4.pyAdded+102
- ChartMimic/dataset/ori_500/area_5.pngAdded
- ChartMimic/dataset/ori_500/area_5.pyAdded+65
- ChartMimic/dataset/ori_500/bar_1.pngAdded
- ChartMimic/dataset/ori_500/bar_1.pyAdded+69
- ChartMimic/dataset/ori_500/bar_10.pngAdded
- ChartMimic/dataset/ori_500/bar_10.pyAdded+57
- ChartMimic/dataset/ori_500/bar_11.pngAdded
- ChartMimic/dataset/ori_500/bar_11.pyAdded+55
- ChartMimic/dataset/ori_500/bar_12.pngAdded
- ChartMimic/dataset/ori_500/bar_12.pyAdded+100
- ChartMimic/dataset/ori_500/bar_18.pngAdded
- ChartMimic/dataset/ori_500/bar_18.pyAdded+60
- ChartMimic/dataset/ori_500/bar_24.pngAdded
- ChartMimic/dataset/ori_500/bar_24.pyAdded+71
- ChartMimic/dataset/ori_500/bar_26.pngAdded
- ChartMimic/dataset/ori_500/bar_26.pyAdded+66
- ChartMimic/dataset/ori_500/bar_27.pngAdded
- ChartMimic/dataset/ori_500/bar_27.pyAdded+103
- ChartMimic/dataset/ori_500/bar_28.pngAdded
- ChartMimic/dataset/ori_500/bar_28.pyAdded+64
- ChartMimic/dataset/ori_500/bar_29.pngAdded
- ChartMimic/dataset/ori_500/bar_29.pyAdded+64
- ChartMimic/dataset/ori_500/bar_30.pngAdded
- ChartMimic/dataset/ori_500/bar_30.pyAdded+85
- ChartMimic/dataset/ori_500/bar_32.pngAdded
- ChartMimic/dataset/ori_500/bar_32.pyAdded+43
- ChartMimic/dataset/ori_500/bar_35.pngAdded
- ChartMimic/dataset/ori_500/bar_35.pyAdded+88
- ChartMimic/dataset/ori_500/bar_37.pngAdded
- ChartMimic/dataset/ori_500/bar_37.pyAdded+105
- ChartMimic/dataset/ori_500/bar_38.pngAdded
- ChartMimic/dataset/ori_500/bar_38.pyAdded+71
- ChartMimic/dataset/ori_500/bar_39.pngAdded
- ChartMimic/dataset/ori_500/bar_39.pyAdded+77
- ChartMimic/dataset/ori_500/bar_4.pngAdded
- ChartMimic/dataset/ori_500/bar_4.pyAdded+127
- ChartMimic/dataset/ori_500/bar_6.pngAdded
- ChartMimic/dataset/ori_500/bar_6.pyAdded+74
- ChartMimic/dataset/ori_500/bar_8.pngAdded
- ChartMimic/dataset/ori_500/bar_8.pyAdded+45
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Fixing random state for reproducibility
# Define custom histogram data for 4 bars decreasing along the diagonalhist = np.array([[4, 0, 0, 0], [0, 3, 0, 0], [0, 0, 2, 0], [0, 0, 0, 1]])
# Define the edges of the binsxedges = np.array([0, 1, 2, 3, 4])yedges = np.array([0, 1, 2, 3, 4])
# Construct arrays for the anchor positions of the 4 bars.xpos, ypos = np.meshgrid(xedges[:-1] + 0.25, yedges[:-1] + 0.25, indexing="ij")xpos = xpos.ravel()ypos = ypos.ravel()zpos = 0
# Only keep positions where there is a non-zero barnon_zero_indices = hist.ravel() > 0xpos = xpos[non_zero_indices]ypos = ypos[non_zero_indices]dz = hist.ravel()[non_zero_indices]
# All bars have the same width and depthdx = dy = 0.5 * np.ones_like(dz)
# Axes Limits and Labelsax_xlabel = "Height"ax_ylabel = "Width"ax_zlabel = "Count"zticks_values = [0, 1, 2, 3, 4]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a new figure for the modified 3D bar plotfig = plt.figure(figsize=(8, 6))ax = fig.add_subplot(projection="3d")
ax.bar3d(xpos, ypos, zpos, dx, dy, dz, zsort="average", color="red")
ax.set_xlabel(ax_xlabel)ax.set_ylabel(ax_ylabel)ax.set_zlabel(ax_zlabel)
ax.set_zticks(zticks_values)
ax.set_box_aspect(aspect=None, zoom=0.8)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("3d_10.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================red = np.array([[10.0, 20.0], [10.0, 30.0], [-50.0, -40.0]])blue = np.array([[20.0, 30.0], [40.0, 70.0], [-40.0, -30.0]])orange = np.array([[30.0, 40.0], [80.0, 90.0], [-20.0, -10.0]])# ===================# Part 3: Plot Configuration and Rendering# ===================fig = plt.figure(figsize=(8, 6))ax = fig.add_subplot(projection="3d")
ax.plot(red[0], red[1], red[2], color="red")ax.plot(blue[0], blue[1], blue[2], color="blue")ax.plot(orange[0], orange[1], orange[2], color="orange")
ax.set_xlabel("Temperature (℃)")ax.set_ylabel("Time (s)")ax.set_zlabel("Depth (m)")
ax.set_xticks([10, 15, 20, 25, 30, 35, 40])ax.set_yticks([10, 30, 50, 70, 90])ax.set_zticks([-50, -40, -30, -20])
ax.set_box_aspect(aspect=None, zoom=0.8)
# ===================# Part 4: Saving Output# ===================# ===================plt.tight_layout()plt.savefig("3d_9.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for plottingx = [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 legendlabel_activity_net_mIoU = "ActivityNet mIoU"label_breakfast_mof = "Breakfast MoF"label_activity_net_cider = "ActivityNet CIDEr"label_qvhighlights_map = "QVHighlights mAP"
# Plot limitsxlim_values = (1, 5)ylim_values = (0, 35)
# Axis labelsxlabel_values = ["10K", "50K", "1M", "5M", "10M"]ylabel_values = [0, 10, 20, 30, 34]
# Axis ticksxticks_values = xyticks_values = [0, 10, 20, 30, 34]
# Horizontal line valueaxhline_value = 30
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plotting the dataplt.figure(figsize=(9, 8)) # Adjusting figure size to match original image dimensionsplt.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 curvesplt.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_valueplt.axhline(axhline_value, color="black", linestyle="dotted")
# Setting the x-axis、y-axis limitsplt.xlim(*xlim_values)plt.ylim(*ylim_values)
# Setting the x-axis tick labelsplt.xticks(xticks_values, xlabel_values)plt.yticks(yticks_values, ylabel_values)
# Adding a legendplt.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")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Data for the plot with new trendsdecomposition_IO_norm = np.array([0, 20, 40, 60, 80])coco_10k = np.array([0.60, 0.70, 0.72, 0.73, 0.74]) + np.array( [0.018, 0.004, 0.01, 0.022, 0.019]) # Small noiselaion_10k = np.array([0.58, 0.67, 0.70, 0.71, 0.73]) + np.array( [-0.01, 0.01, -0.002, -0.001, 0.004])coco_5k = np.array([0.56, 0.66, 0.67, 0.68, 0.68]) # Changed last point to non-Nonelaion_5k = np.array([0.55, 0.61, 0.64, 0.65, 0.66]) # Continuation of the trendclip = np.linspace(0.75, 0.75, len(decomposition_IO_norm)) # Make clip a full line
# Extracted variablesfill_label_coco_10k = "coco (10k)"fill_label_laion_10k = "laion (10k)"fill_label_coco_5k = "coco (5k)"fill_label_laion_5k = "laion (5k)"plot_label_clip = "clip"title_text = "Dynamic Effect of Vocab on Zero Shot Accuracy"xlabel_text = "Decomposition IO Norm"ylabel_text = "Accuracy"xlim_values = (min(decomposition_IO_norm), max(decomposition_IO_norm))ylim_values = (0.53, 0.76)xticks_values = decomposition_IO_normyticks_values = [0.53, 0.55, 0.60, 0.65, 0.70, 0.75, 0.76]legend_title = "Dataset"legend_loc = "upper center"legend_bbox_to_anchor = (0.5, 1.12)legend_ncol = 5
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the plot with a different visualization styleplt.figure(figsize=(10, 6))plt.fill_between( decomposition_IO_norm, coco_10k, color="red", alpha=0.3, label=fill_label_coco_10k)plt.fill_between( decomposition_IO_norm, laion_10k, color="green", alpha=0.3, label=fill_label_laion_10k,)plt.fill_between( decomposition_IO_norm, coco_5k, color="blue", alpha=0.3, label=fill_label_coco_5k)plt.fill_between( decomposition_IO_norm, laion_5k, color="orange", alpha=0.3, label=fill_label_laion_5k,)plt.plot( decomposition_IO_norm, clip, color="black", linestyle="--", linewidth=2, label=plot_label_clip,)
# Add a title and labels with enhanced formattingplt.title(title_text, fontsize=14, y=1.1)plt.xlabel(xlabel_text, fontsize=12)plt.ylabel(ylabel_text, fontsize=12)plt.xticks(xticks_values)plt.yticks(yticks_values)plt.gca().tick_params(axis="both", which="both", length=0)
# Setting the limits explicitly to prevent cut-offsplt.xlim(*xlim_values)plt.ylim(*ylim_values)
# Adding a legend with a titleplt.legend( title=legend_title, frameon=False, reverse=True, framealpha=0.8, loc=legend_loc, bbox_to_anchor=legend_bbox_to_anchor, ncol=legend_ncol,)
# ===================# Part 4: Saving Output# ===================# Adjust layout to ensure no clippingplt.tight_layout()plt.savefig("area_3.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datan_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 chartcumulative_content = contentcumulative_organization = cumulative_content + organizationcumulative_language = cumulative_organization + language
# Positions for the bars on the x-axisind = np.arange(len(n_aug))
# Variables for plot configurationcontent_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 = 12legend_frameon = Falselegend_shadow = Truelegend_facecolor = "#ffffff"legend_ncol = 3legend_bbox_to_anchor = (0.5, 1.2)
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plotfig, ax = plt.subplots(figsize=(8, 4)) # Adjusted for better aspect ratioax.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 visualsax.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 dynamicallyax.set_ylim(*ylim_values) # Ensure all data fits wellax.set_xlim(*xlim_values)# Labels, Title and Gridax.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 legendax.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,)
# Gridax.grid(True, linestyle="--", alpha=0.5, which="both")
# ===================# Part 4: Saving Output# ===================# Adjusting layout to reduce white spaceplt.tight_layout()plt.savefig("area_4.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport 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 variableslegend_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 = Falselegend_frameon = Falselegend_ncol = 5legend_bbox_to_anchor = (0.5, 1.08)title_y_position = 1.08colors = ["#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")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# DataN = 5notre_dame = (0, 0.6, 0.2, 0.1)demi_gods = (0, 0.7, 0.3, 0.2)monte_cristo = (0, 0.5, 0.1, 0.3)game_of_thrones = (0, 0.4, 0.4, 0.2)attack_on_titan = (0, 0.3, 0.2, 0.1)
ind = np.arange(4) # the x locations for the groupswidth = 0.1 # the width of the bars
# Axes Limits and Labelsylabel_value = "Scores"xlim_values = [0.7, 3.7]xticklabels = ("0", "20", "40", "60")legend_labels = ( "Notre-Dame de Paris", "Demi-Gods and Semi-Devils", "The Count of Monte Cristo", "Game of Thrones", "Attack on Titan",)colors = ( "#495c80", "#6d8abb", "#eadcd1", "#5899b8", "#2b5a75",)
# ===================# Part 3: Plot Configuration and Rendering# ===================fig = plt.figure(figsize=(7, 5)) # Adjusting figure size as per the given dimensionsax = fig.add_subplot(111)
rects1 = ax.bar(ind, notre_dame, width, color=colors[0])rects2 = ax.bar(ind + width, demi_gods, width, color=colors[1])rects3 = ax.bar(ind + 2 * width, monte_cristo, width, color=colors[2])rects4 = ax.bar(ind + 3 * width, game_of_thrones, width, color=colors[3])rects5 = ax.bar(ind + 4 * width, attack_on_titan, width, color=colors[4])
ax.set_ylabel(ylabel_value)ax.set_xlim(xlim_values)ax.set_xticks(ind + 7 * width)ax.set_xticklabels(xticklabels)
ax.legend( (rects1[0], rects2[0], rects3[0], rects4[0], rects5[0]), legend_labels,)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_1.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Datacategories = [ "Which", "What", "How", "Will", "Are", "Is", "Choose", "Select", "Identify", "Fill",]values = [40, 30, 45, 50, 55, 50, 55, 55, 50, 45]
# Plot labels and titlesylabel = "Accuracy (%)"ylim = (0, 60)yticks = [0, 10, 20, 30, 40, 50, 60]xticks = categories # Assuming xticks are the same as categoriesxtickslabel_rotation = 0 # Assuming no rotation is needed
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create figure and axisfig, ax = plt.subplots(figsize=(8, 6)) # Width, Height in inches
# Bar chartax.bar(categories, values, color="#7badd2")
# Set labels and titleax.set_ylabel(ylabel)ax.set_ylim(ylim) # Set y-axis limit to match the pictureax.set_yticks(yticks)ax.tick_params(axis="both", which="both", length=0)# Rotate x-axis labelsplt.xticks(ticks=xticks, rotation=xtickslabel_rotation)
# Hide the borderax.spines["top"].set_visible(False)ax.spines["right"].set_visible(False)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_10.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for plottingcategories = ["0-9", "10-19", "20-29", "30-39", "40-49"]values = [0.60, -0.55, -0.76, -0.80, -0.85]
# Plot configuration variablesylabel = "spearman"xlabel = "length"xlim = (-0.5, 4.5)ylim = (-1, 0.75)yticks = [-1.00, -0.75, -0.5, -0.25, 0, 0.25, 0.50, 0.75]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the figure and the bar chartfig, ax = plt.subplots(figsize=(6, 6))bars = ax.bar(categories, values, color="#44739d", edgecolor="white", width=1, zorder=3)
# Set labels and titleax.set_ylabel(ylabel)ax.set_xlabel(xlabel)ax.set_xlim(xlim)ax.set_ylim(ylim)ax.tick_params(axis="y", which="both", length=0)ax.tick_params(axis="x", which="both", length=0)ax.set_yticks(yticks)ax.set_facecolor("#eaeaf2") # Set the axes background colorax.yaxis.grid(True, color="white", zorder=2) # Add grid lines
# Remove the border around the chart areafor spine in ax.spines.values(): spine.set_visible(False)
# Ensure that the bars for negative values start from zerofor bar in bars: if bar.get_height() < 0: bar.set_y(0)
# Add padding around the chartplt.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
# ===================# Part 4: Saving Output# ===================# Show the plotplt.tight_layout()plt.savefig("bar_11.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for the plotsmodels = ["GRU4Rec", "Caser", "SASRec", "BERT4Rec", "FMLP-Rec"]beauty_values = [14.3, 19.9, 2.4, 11.2, 2.2]movielens_values = [3.1, 2.9, 4.1, 5.1, 3.0]yelp_values = [19.7, -0.5, -0.5, 4.8, -0.7]
title1 = "Beauty"axvline1 = 0title2 = "MovieLens-1M"axvline2 = 0title3 = "Yelp"axvline3 = 0
xticks1 = [0, 2.5, 5]xticks2 = [0, 2.5, 5]xticks3 = [0, 10, 20]
xlable = "▲%"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Set the figure size to match the original image's dimensionsfig, axes = plt.subplots(1, 3, figsize=(10, 4))
# Plot for Beautyaxes[0].barh(models, beauty_values, color="white", edgecolor="black")axes[0].set_title(title1)for i, v in enumerate(beauty_values): axes[0].text( v - 0.5 if v < 0 else v + 0.5, i, f"{v}%", color="black", va="center", ha="right" if v < 0 else "left", )axes[0].axvline(axvline1, color="black")
# Plot for MovieLens-1Maxes[1].barh(models, movielens_values, color="white", edgecolor="black")axes[1].set_title(title2)for i, v in enumerate(movielens_values): axes[1].text( v - 0.2 if v < 0 else v + 0.2, i, f"{v}%", color="black" if v > 0 else "red", va="center", ha="right" if v < 0 else "left", )axes[1].axvline(axvline2, color="black")axes[1].set_xticks(xticks1)
# Plot for Yelpaxes[2].barh(models, yelp_values, color="white", edgecolor="black")axes[2].set_title(title3)for i, v in enumerate(yelp_values): axes[2].text( v - 0.5 if v < 0 else v + 0.5, i, f"{v}%", color="black" if v > 0 else "red", va="center", ha="right" if v < 0 else "left", )axes[2].axvline(axvline3, color="black")axes[2].set_xticks(xticks2)
# Hide all axes except the bottom onefor ax in axes: for spine in ["left", "right", "top"]: ax.spines[spine].set_visible(False)
# Hide y-axis labels for axes[1] and axes[2]axes[1].set_yticks([])axes[1].set_yticklabels([])axes[2].set_yticks([])axes[2].set_yticklabels([])
# Add x-axis label for all axesfor ax in axes: ax.set_xlabel(xlable)
plt.subplots_adjust(wspace=0.5)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_12.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# ===================# Datadatasets = ["GSM8K", "MNLI", "race@High"]M3 = [45, 60, 55]M4 = [50, 65, 60]M5 = [55, 72, 65]M6 = [60, 70, 60]M7 = [65, 70, 60]
barWidth = 0.15r1 = np.arange(len(M3))r2 = [x + barWidth for x in r1]r3 = [x + barWidth for x in r2]r4 = [x + barWidth for x in r3]r5 = [x + barWidth for x in r4]
labels = ["M = 3", "M = 4", "M = 5", "M = 6", "M = 7"]ylabel = "Performance"ylim = [35, 75]yticks = [35, 40, 45, 50, 55, 60, 65, 70, 75]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create figureplt.figure(figsize=(10, 6)) # Adjusted to match the original image's dimensions
# Create barsplt.bar(r1, M3, color="#dee9f5", width=barWidth, edgecolor="black", label=labels[0])plt.bar(r2, M4, color="#c0d5e9", width=barWidth, edgecolor="black", label=labels[1])plt.bar(r3, M5, color="#94bdd9", width=barWidth, edgecolor="black", label=labels[2])plt.bar(r4, M6, color="#669cc9", width=barWidth, edgecolor="black", label=labels[3])plt.bar(r5, M7, color="#437ab5", width=barWidth, edgecolor="black", label=labels[4])
# Add xticks on the middle of the group barsplt.xticks([r + barWidth * 2 for r in range(len(M3))], datasets)
# Create legend & Show graphicplt.legend(loc="upper left")plt.ylabel(ylabel)plt.ylim(ylim)plt.yticks(yticks)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_18.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datamodels = [ "Majority", "Flan-T5", "GPT-3.5", "GPT-4", "Wizard13b", "Vicuna13b", "Vicuna33b", "Mistral17b",]accuracy = [0.302, 0.601, 0.468, 0.653, 0.384, 0.379, 0.347, 0.364]colors = [ "#3f5e8a", "#41778c", "#478f8c", "#51a686", "#69bd78", "#8fcf63", "#c4de50", "#fae856",]xlabel = "Models"xticks = np.arange(len(models))ylabel = "Accuracy"ylim = [0, 1.0]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create figure and bar chartfig, ax = plt.subplots(figsize=(8, 4))bars = ax.bar(models, accuracy, color=colors)
# Add accuracy values on top of the barsfor bar in bars: yval = bar.get_height() plt.text( bar.get_x() + bar.get_width() / 2, yval, round(yval, 3), ha="center", va="bottom", )
# Set axis labels and titleax.set_ylabel(xlabel)ax.set_xticks(xticks)ax.set_xticklabels(models, rotation=45, ha="center")ax.set_xlabel(ylabel)
ax.set_ylim(ylim)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_24.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Dataemotions = ["Ang", "Cnt", "Dis", "Fea", "Joy", "Ntr", "Sad", "Sur"]negative = [500, 300, 200, 1000, 0, 0, 500, 0]positive = [0, 0, 0, 0, 2000, 0, 0, 0]none = [0, 0, 0, 0, 0, 3500, 0, 0]mixed = [0, 0, 0, 0, 0, 0, 0, 300]labels = ["negative", "positive", "none", "mixed"]xlabel = "Emotions"ylabel = "Frequency"ylim = [0, 4000]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Set figure size to match the original image's dimensionsplt.figure(figsize=(6, 4))
# Plottingbar_width = 0.8index = np.arange(len(emotions))
plt.bar(index, negative, bar_width, color="red", label=labels[0])plt.bar(index, positive, bar_width, color="green", label=labels[1], bottom=negative)plt.bar( index, none, bar_width, color="grey", label=labels[2], bottom=[i + j for i, j in zip(negative, positive)],)plt.bar( index, mixed, bar_width, color="orange", label=labels[3], bottom=[i + j + k for i, j, k in zip(negative, positive, none)],)
# Labels and Titleplt.xlabel(xlabel)plt.ylabel(ylabel)plt.ylim(ylim)# plt.title('Emotion Frequencies by Sentiment')plt.xticks(index, emotions)plt.legend(loc="upper left")
# ===================# Part 4: Saving Output# ===================# Show plotplt.tight_layout()plt.savefig("bar_26.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Data for the bar chartscategories = ["RoboCodeX", "GPT-4V"] # Swap the ordersuccess = [0.5, 0.6] # Swap the ordergrounding_error = [0.15, 0.1] # Swap the orderoccupancy_error = [0.1, 0.05] # Swap the ordergripper_collision = [0.05, 0.05] # Swap the ordertrajectory_optimization_error = [0.1, 0.1] # Swap the ordergrasping_failed = [0.1, 0.1] # Swap the order
# Colors for each segmentcolors = ["green", "grey", "orange", "yellow", "blue", "purple"]bar_width = 0.5y_pos = range(len(categories))labels = ["Success", "Grounding Error", "Occupancy Error", "Gripper collision", "Trajectory optimization Error", "Grasping failed"]xlabel = "Percentage of Total Trials"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create a figure with a specific size to match the original image's dimensionsfig, ax = plt.subplots(figsize=(10, 3))
# Stack the bars horizontallyax.barh(y_pos, success, bar_width, color=colors[0], label=labels[0])ax.barh( y_pos, grounding_error, bar_width, left=success, color=colors[1], label=labels[1],)ax.barh( y_pos, occupancy_error, bar_width, left=[i + j for i, j in zip(success, grounding_error)], color=colors[2], label=labels[2],)ax.barh( y_pos, gripper_collision, bar_width, left=[i + j + k for i, j, k in zip(success, grounding_error, occupancy_error)], color=colors[3], label=labels[3],)ax.barh( y_pos, trajectory_optimization_error, bar_width, left=[ i + j + k + l for i, j, k, l in zip( success, grounding_error, occupancy_error, gripper_collision ) ], color=colors[4], label=labels[4],)ax.barh( y_pos, grasping_failed, bar_width, left=[ i + j + k + l + m for i, j, k, l, m in zip( success, grounding_error, occupancy_error, gripper_collision, trajectory_optimization_error, ) ], color=colors[5], label=labels[5],)
# Set the y-axis labelsax.set_yticks(y_pos)ax.set_yticklabels(categories)
# Set the x-axis labelax.set_xlabel(xlabel)
# Add a legendax.legend(loc="upper center", bbox_to_anchor=(0.5, 1.5), ncol=3, frameon=False)
# ===================# Part 4: Saving Output# ===================# Show the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_27.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# ===================# Datadatasets = ["VOC 2012", "COCO 2017"]jpeg = [3.1, 1.5]deepjscc = [1.5, 2.5]ours = [0.5, 1.0]
# X-axis positionsx = np.arange(len(datasets))
# Bar widthwidth = 0.2labels = ["JPEG", "DEEPJSCC w/ ofdm", "OURS"]ylim = [0, 4.3]ylabel = "Transmission Delay (ms)"xlabel = "Datasets"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots( figsize=(6, 5)) # Adjusting figure size to match the original image's dimensionsax.bar( x - width, jpeg, width, label=labels[0], hatch="//", edgecolor="black", color="white")ax.bar( x, deepjscc, width, label=labels[1], hatch="..", edgecolor="black", color="white",)ax.bar( x + width, ours, width, label=labels[2], hatch="xx", edgecolor="black", color="white")
# Labels and Titleax.set_ylim(ylim)ax.set_ylabel(ylabel)ax.set_xlabel(xlabel)ax.set_xticks(x)ax.set_xticklabels(datasets)ax.legend(loc="upper left")
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_28.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# ===================# Datapdes = ["Wave", "Diffusion", "Heat", "Poisson", "Burgers", "N-S"]rbf_int = [1e-2, 1e-3, 1e-2, 1e-2, 1e-3, 1e-2]rbf_pol = [1e-1, 1e-4, 1e-2, 1e-2, 1e-3, 1e-1]rbf_com = [1e-1, 1e-3, 1e-2, 1e-2, 1e-3, 1e-1]
x = np.arange(len(pdes)) # the label locationswidth = 0.25 # the width of the bars
# Labels for legendlabel_rbf_int = "RBF-INT"label_rbf_pol = "RBF-POL"label_rbf_com = "RBF-COM"
# Axis labelsxlabel = "PDEs"ylabel = "log L2"
# Axis ticksxticks = xyticks = [1e-4, 1e-3, 1e-2, 1e-1]
# Axis tick labelsxticklabels = pdesyticklabels = ["1e-4", "1e-3", "1e-2", "1e-1"]
# ===================# Part 3: Plot Configuration and Rendering# ===================fig, ax = plt.subplots(figsize=(10, 6))rects1 = ax.bar(x - width, rbf_int, width, label=label_rbf_int, color="#3c0f64")rects2 = ax.bar(x, rbf_pol, width, label=label_rbf_pol, color="#ae4256")rects3 = ax.bar(x + width, rbf_com, width, label=label_rbf_com, color="#e47f37")
ax.set_ylabel(ylabel)ax.set_yscale("log")ax.set_xlabel(xlabel)ax.set_xticks(xticks)ax.set_xticklabels(xticklabels)
# Set custom y-ticks on the log scale and their labelsax.set_yticks(yticks)ax.set_yticklabels(yticklabels)
ax.legend(ncol=3, loc="upper center", bbox_to_anchor=(0.5, 1.1), frameon=False)
ax.tick_params(axis="both", which="both", length=0)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_29.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datamodels = ["Mixtral-8x7b-Instruct", "GPT-3.5", "GPT-4"]zero_shot = [6.11, 44.44, 42.78]one_shot = [28.33, 56.11, 60.56]ds_agent = [31.11, 85.00, 99.44]
# X-axis positionsx = np.arange(len(models))
# Bar widthbar_width = 0.2gap_width = 0.02
labels = ["Zero-shot", "One-shot", "DS-Agent"]ylabel = "One pass rate (%)"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plotting barsfig, ax = plt.subplots(figsize=(6, 4)) # Adjusting figure size to match 468x360 pixelsrects1 = ax.bar( x - bar_width - gap_width, zero_shot, bar_width, label=labels[0], color="#f2a49e")rects2 = ax.bar(x, one_shot, bar_width, label=labels[1], color="#a9c8f0")rects3 = ax.bar( x + bar_width + gap_width, ds_agent, bar_width, label=labels[2], color="#cdbcfa")
# Adding text for labels, title, and custom x-axis tick labelsax.set_ylabel(ylabel)ax.set_xticks(x)ax.set_xticklabels(models)ax.legend(loc="lower center", bbox_to_anchor=(0.5, -0.2), ncol=3)
# Adding data labels inside the barsdef autolabel(rects): for rect in rects: height = rect.get_height() ax.annotate( "{}".format(height), xy=(rect.get_x() + rect.get_width() / 2, height + 2), xytext=(0, 0), # No offset textcoords="offset points", ha="center", va="center", color="black", fontsize=8, )
autolabel(rects1)autolabel(rects2)autolabel(rects3)
# Adjusting the layout and font sizesax.tick_params(axis="x", labelsize=8)ax.tick_params(axis="y", labelsize=8)ax.yaxis.label.set_size(8)
# Adding gridax.grid(axis="y", linestyle="--", alpha=0.6)ax.grid(axis="x", linestyle="--", alpha=0.6)ax.set_axisbelow(True)
plt.subplots_adjust(bottom=0.2, top=0.95)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_30.pdf", bbox_inches="tight")12345678910111213141516171819202122232425262728293031323334353637383940414243# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Datacategories = ["Shear Sheep", "Milk Cow", "Combat Spider"]values = [0.56, 0.74, 0.72]
# Axes limits, labels, and ticksxlabel = "Probability of Improvement"xticks = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]xtickslabel = ["0.0", "", "0.2", "", "0.4", "", "0.6", "", "0.8", "", "1.0"]title = "Probability of Improvement over VLM Image Encoder Baseline Returns"
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create horizontal bar chartplt.figure(figsize=(6, 2)) # Adjusting figure size to match original image dimensionsplt.barh(categories, values, color="#3b76af")
# Adding data labelsfor index, value in enumerate(values): plt.text(value, index, f" {value}", va="center", color="black")
# Adding title and labelsplt.title(title)plt.xlabel(xlabel)# Apply the xticks and labelsplt.xticks(xticks, xtickslabel)
plt.tick_params(axis="both", which="both", length=0)
# ===================# Part 4: Saving Output# ===================# Show plot with tight layoutplt.tight_layout()plt.savefig("bar_32.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# ===================# Datamethods = ["Random", "Uniform", "G2S", "S2G", "ClusterClip"]scores_llama2 = [5.52, 5.53, 5.83, 5.54, 5.84]scores_mistral = [6.57, 6.75, 6.81, 7.08, 6.90]
index = [6, 12]
# Colors (approximated from the image)colors = ["#837ba8", "#aa6262", "#6e9d72", "#c38c6a", "#5e74a0"]
# Labels for legend and plot typelabels = methods# Limits, labels, and title for the plotylim_values = (5.0, 7.5)ylabel_value = "MT-Bench Score"xticks_values = indexxtickslabel_values = ["Llama2", "Mistral"]# Bar widthbar_width = 1# X-axis positionsr1 = np.arange(len(methods))r2 = [x + bar_width + len(r1) for x in r1]
# ===================# Part 3: Plot Configuration and Rendering# ===================plt.figure(figsize=(8, 5))# Create barsfor i in range(len(r1)): plt.bar( index[0] + (i - 2) * bar_width, scores_llama2[i], color=colors[i], width=bar_width, edgecolor="white", label=labels[i], )
for i in range(len(r2)): plt.bar( index[1] + (i - 2) * bar_width, scores_mistral[i], color=colors[i], width=bar_width, edgecolor="white", )
# Add text on top of the barsfor i in range(len(r1)): plt.text( index[0] + (i - 2) * bar_width, scores_llama2[i] + 0.05, str(scores_llama2[i]), ha="center", ) plt.text( index[1] + (i - 2) * bar_width, scores_mistral[i] + 0.05, str(scores_mistral[i]), ha="center", )
# General layoutplt.xticks(xticks_values, xtickslabel_values)plt.ylabel(ylabel_value)plt.ylim(*ylim_values)plt.legend(loc="upper center", ncol=5, bbox_to_anchor=(0.5, 1.1), frameon=False)
plt.tick_params(axis="x", which="both", length=0)plt.gca().yaxis.grid(True)plt.gca().set_axisbelow(True)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_35.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datamodels = ["ResNet18", "AlexNet", "ResNet50"]speedup = { "0%": [1.0, 1.0, 1.0], "50%": [1.8, 1.9, 1.6], "4:8": [2.6, 2.9, 1.8], "75%": [3.3, 3.4, 2.7], "6:8": [4.6, 5.2, 2.9], "87.50%": [4.5, 6.1, 3.9], "7:8": [7.4, 8.7, 4.3],}
# Colors for the barscolors = ["#de9aa4", "#bc9c58", "#8ea654", "#65ab91", "#67a9b6", "#a3ade5", "#da8fdc"]
# Plot labels and typesylabel_text = "Speedup"xlabel_text = "Models"title_text = "Model Speedup Comparison"legend_title = "Perturbation"bar_label_fontsize = 10ylabel_fontsize = 12
# Plot limits and ticksylim_values = (0, 10)yticks_values = [0, 2, 4, 6, 8, 10]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Setup the figure and axesfig, ax = plt.subplots(figsize=(12, 4))
# Bar widthbar_width = 0.1
# Positions of the bars on the x-axisr = np.arange(len(models))
# Create bars for each perturbationfor i, (perturbation, values) in enumerate(speedup.items()): ax.bar( r + i * bar_width, values, color=colors[i], width=bar_width, edgecolor="white", label=perturbation, )
# Add labels on top of the barsfor i, (perturbation, values) in enumerate(speedup.items()): for j, value in enumerate(values): ax.text( j + i * bar_width, value + 0.1, str(value), ha="center", va="bottom", fontsize=bar_label_fontsize, )
# General layoutax.set_ylabel(ylabel_text, fontsize=ylabel_fontsize)ax.set_xticks(r + bar_width * (len(speedup) - 1) / 2)ax.set_xticklabels(models)ax.set_ylim(*ylim_values)ax.set_yticks(yticks_values)ax.legend( title=legend_title, loc="upper center", bbox_to_anchor=(0.5, 1.2), frameon=False, ncol=7,)ax.set_facecolor("#eaeaf2")ax.yaxis.grid(True, color="white")ax.set_axisbelow(True)
# Remove spinesax.spines["top"].set_visible(False)ax.spines["right"].set_visible(False)ax.spines["bottom"].set_visible(False)ax.spines["left"].set_visible(False)
plt.tick_params(axis="both", which="both", length=0)
# ===================# Part 4: Saving Output# ===================fig.set_size_inches(12, 4)plt.tick_params(axis="both", which="both", length=0)plt.tight_layout()plt.savefig("bar_37.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Data (estimated from the image)models = ["CL-7b", "CL-13b", "CL-34b", "DS-6.7b", "DS-33b", "SC"]correct = [20, 30, 25, 60, 55, 40]counterfeit_passing = [30, 40, 35, 50, 60, 50]counterfeit_failing = [10, 15, 12, 20, 30, 15]counterfeit_confused = [15, 30, 25, 30, 35, 40]
# Bar positionsx = np.arange(len(models))width = 0.15 # Adjusted width for spacinglabels = ["Correct", "Counterfeit (Test-Passing)", "Counterfeit (Test-Failing)", "Counterfeit (Test-Failing), Confused"]ylabel = "Accuracy"title = "LeetCode, DS-6.7b"ylim = [0, 100]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots( figsize=(7, 5)) # Adjusted to match the image dimensions (504x360)
ax.bar(x - width * 2, correct, width, label=labels[0], color="#c0e4b8") # Lighter greenax.bar( x - width, counterfeit_passing, width, label=labels[1], color="#97ccf6",) # Lighter blueax.bar( x, counterfeit_failing, width, label=labels[2], color="#e48b88") # Lighter redax.bar( x + width, counterfeit_confused, width, label=labels[3], hatch="/", color="#cac4e1",) # Lighter purple
# Labels and Titleax.set_ylabel(ylabel)ax.set_title(title)ax.set_xticks(x)ax.set_xticklabels(models)ax.set_ylim(ylim) # Adjusted y-axis limit
# Move legend inside the plot areaax.legend(loc="upper left")
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_38.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as plt
# ===================# Part 2: Data Preparation# ===================# Datacategories = ["Vicuna", "Koala", "WizardLM", "SInstruct", "LIMA"][::-1]recost_wins = [53, 80, 116, 99, 179][::-1]ties = [6, 33, 49, 50, 23][::-1]alpaca_wins = [21, 67, 53, 103, 98][::-1]
labels = ["Recost (1%) wins", "Tie", "Alpaca wins"]bar_width = 0.5y_pos = range(len(categories))
# ===================# Part 3: Plot Configuration and Rendering# ===================# Stacked Bar Chartfig, ax = plt.subplots( figsize=(8, 5)) # Adjusted to match the original image's dimensions
ax.barh(y_pos, recost_wins, bar_width, color="#e4754f", label=labels[0])ax.barh(y_pos, ties, bar_width, left=recost_wins, color="#feffc7", label=labels[1])ax.barh( y_pos, alpaca_wins, bar_width, left=[i + j for i, j in zip(recost_wins, ties)], color="#81acce", label=labels[2],)
# Adding the numerical values within each segmentfor i in range(len(categories)): ax.text( recost_wins[i] / 2, i, str(recost_wins[i]), ha="center", va="center", color="white", ) ax.text( recost_wins[i] + ties[i] / 2, i, str(ties[i]), ha="center", va="center", color="black", ) ax.text( recost_wins[i] + ties[i] + alpaca_wins[i] / 2, i, str(alpaca_wins[i]), ha="center", va="center", color="white", )
# Labels and Legendax.set_xticks([])ax.set_yticks(y_pos)ax.set_yticklabels(categories)ax.legend(loc="upper right")
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_39.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127# ===================# Part 1: Importing Libraries# ===================import matplotlib.pyplot as pltimport numpy as np
np.random.seed(0)
# ===================# Part 2: Data Preparation# ===================# Datalabels = [ "CometKiwi", "LaBSE", "IF", "Max", "STARE", "Ppl", "ALTI+", "Wass Combo", "IF", "Max", "STARE", "IF", "Max", "STARE",]non_aggregation = [35.15, 26.86, 0, 0, 0, 58.99, 66.19, 48.38, 0, 0, 0, 0, 0, 0]aggregation = [ 0, 0, 19.08, 22.09, 20.67, 0, 0, 0, 36.63, 62.94, 42.50, 23.90, 26.38, 17.06,]
x = np.arange(len(labels)) # the label locationswidth = 0.7 # the width of the bars
line_y_1 = 18line_y_2 = 28line_x_1 = 4.5line_x_2 = 10.5
# Labels and Plot Typeslabel_Non_Aggregation = "Non-Aggregation"label_Aggregation = "Aggregation"legend_title = "Aggregation"
# Axes Limits and Labelsylabel_value = "FPR@90TPR"title_value = "FPR@90TPR on Guerreiro et al. 2022"ylim_values = [0, 80]xlim_values = [-0.6, 14]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Plottingfig, ax = plt.subplots( figsize=(10, 5)) # Adjust the size to match the original image's dimensionsrects1 = ax.bar(x, non_aggregation, width, label=label_Non_Aggregation, color="#81b4a2")rects2 = ax.bar(x, aggregation, width, label=label_Aggregation, color="#dd997b")
# Add some text for labels, title and custom x-axis tick labels, etc.ax.set_ylabel(ylabel_value)ax.set_title(title_value)ax.set_xticks(x)ax.set_xticklabels(labels, rotation=45, ha="center")ax.set_ylim(ylim_values)ax.set_xlim(xlim_values)
# Adding the values on top of the barsfor rect in rects1: if rect.get_height() > 0: height = rect.get_height() ax.annotate( "{}".format(height), xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 3), # 3 points vertical offset textcoords="offset points", ha="center", va="bottom", )for rect in rects2: if rect.get_height() > 0: height = rect.get_height() ax.annotate( "{}".format(height), xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 3), # 3 points vertical offset textcoords="offset points", ha="center", va="bottom", )
# Reference linesax.axhline(y=line_y_1, color="red", linestyle="--")ax.axhline(y=line_y_2, color="gray", linestyle="--")ax.axvline(x=line_x_1, color="gray", linestyle="--")ax.axvline(x=line_x_2, color="gray", linestyle="--")
# 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=legend_title)
# ===================# Part 4: Saving Output# ===================plt.tight_layout()plt.savefig("bar_4.pdf", bbox_inches="tight")1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374# ===================# 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", "Excitement", "Delight", "Oblivious", "Embarrassment", "Disappointment",]
# Approximate frequency values based on the imagefrequencies = [ 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 chartplt.figure(figsize=(8, 8)) # Adjust figure sizeplt.barh(emotions, frequencies, color="#84ade3")
# Set x-axis limitsplt.xlim(xlim)
# Set x-axis ticksplt.xticks(xticks)
# Set labels and titleplt.xlabel(xlabel)plt.ylabel(ylabel)
# ===================# Part 4: Saving Output# ===================# Show the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_6.pdf", bbox_inches="tight")123456789101112131415161718192021222324252627282930313233343536373839404142434445# ===================# 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]xlabel = "Top-10 superfamilies in training dataset"ylabel = "Accuracy"ylim = (0.0, 1.1)yticks = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
# ===================# Part 3: Plot Configuration and Rendering# ===================# Create the bar chartplt.figure( figsize=(10, 6)) # Adjusting figure size to match the original image's dimensionsplt.bar(superfamilies, accuracies, color="#7fa9cc")
# Add a horizontal line for the average accuracyaverage_accuracy = sum(accuracies) / len(accuracies)plt.axhline(y=average_accuracy, color="red", linestyle="--")
# Add labels and titleplt.xlabel(xlabel)plt.ylabel(ylabel)
# Set y-axis limitsplt.ylim(ylim)# Set x-axis,y-axis ticksplt.xticks(superfamilies)plt.yticks(yticks)
# ===================# Part 4: Saving Output# ===================# Displaying the plot with tight layout to minimize white spaceplt.tight_layout()plt.savefig("bar_8.pdf", bbox_inches="tight")ChartMimic/dataset/ori_500/3d_10.pngAdded

ChartMimic/dataset/ori_500/3d_10.pyAdded+65
ChartMimic/dataset/ori_500/3d_9.pngAdded

ChartMimic/dataset/ori_500/3d_9.pyAdded+41
ChartMimic/dataset/ori_500/area_1.pngAdded

ChartMimic/dataset/ori_500/area_1.pyAdded+116
ChartMimic/dataset/ori_500/area_3.pngAdded

ChartMimic/dataset/ori_500/area_3.pyAdded+104
ChartMimic/dataset/ori_500/area_4.pngAdded

ChartMimic/dataset/ori_500/area_4.pyAdded+102
ChartMimic/dataset/ori_500/area_5.pngAdded

ChartMimic/dataset/ori_500/area_5.pyAdded+65
ChartMimic/dataset/ori_500/bar_1.pngAdded

ChartMimic/dataset/ori_500/bar_1.pyAdded+69
ChartMimic/dataset/ori_500/bar_10.pngAdded

ChartMimic/dataset/ori_500/bar_10.pyAdded+57
ChartMimic/dataset/ori_500/bar_11.pngAdded

ChartMimic/dataset/ori_500/bar_11.pyAdded+55
ChartMimic/dataset/ori_500/bar_12.pngAdded

ChartMimic/dataset/ori_500/bar_12.pyAdded+100
ChartMimic/dataset/ori_500/bar_18.pngAdded

ChartMimic/dataset/ori_500/bar_18.pyAdded+60
ChartMimic/dataset/ori_500/bar_24.pngAdded

ChartMimic/dataset/ori_500/bar_24.pyAdded+71
ChartMimic/dataset/ori_500/bar_26.pngAdded

ChartMimic/dataset/ori_500/bar_26.pyAdded+66
ChartMimic/dataset/ori_500/bar_27.pngAdded

ChartMimic/dataset/ori_500/bar_27.pyAdded+103
ChartMimic/dataset/ori_500/bar_28.pngAdded

ChartMimic/dataset/ori_500/bar_28.pyAdded+64
ChartMimic/dataset/ori_500/bar_29.pngAdded

ChartMimic/dataset/ori_500/bar_29.pyAdded+64
ChartMimic/dataset/ori_500/bar_30.pngAdded

ChartMimic/dataset/ori_500/bar_30.pyAdded+85
ChartMimic/dataset/ori_500/bar_32.pngAdded

ChartMimic/dataset/ori_500/bar_32.pyAdded+43
ChartMimic/dataset/ori_500/bar_35.pngAdded

ChartMimic/dataset/ori_500/bar_35.pyAdded+88
ChartMimic/dataset/ori_500/bar_37.pngAdded

ChartMimic/dataset/ori_500/bar_37.pyAdded+105
ChartMimic/dataset/ori_500/bar_38.pngAdded

ChartMimic/dataset/ori_500/bar_38.pyAdded+71
ChartMimic/dataset/ori_500/bar_39.pngAdded

ChartMimic/dataset/ori_500/bar_39.pyAdded+77
ChartMimic/dataset/ori_500/bar_4.pngAdded

ChartMimic/dataset/ori_500/bar_4.pyAdded+127
ChartMimic/dataset/ori_500/bar_6.pngAdded

ChartMimic/dataset/ori_500/bar_6.pyAdded+74
ChartMimic/dataset/ori_500/bar_8.pngAdded

ChartMimic/dataset/ori_500/bar_8.pyAdded+45