merterm commited on
Commit
962f708
·
verified ·
1 Parent(s): faedad5

Upload 102 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. ChartMimic/dataset/ori_500/3d_10.png +0 -0
  2. ChartMimic/dataset/ori_500/area_1.py +116 -0
  3. ChartMimic/dataset/ori_500/area_4.py +102 -0
  4. ChartMimic/dataset/ori_500/area_5.py +65 -0
  5. ChartMimic/dataset/ori_500/bar_48.png +0 -0
  6. ChartMimic/dataset/ori_500/bar_51.py +50 -0
  7. ChartMimic/dataset/ori_500/bar_6.py +74 -0
  8. ChartMimic/dataset/ori_500/bar_60.png +0 -0
  9. ChartMimic/dataset/ori_500/bar_61.png +0 -0
  10. ChartMimic/dataset/ori_500/bar_63.png +0 -0
  11. ChartMimic/dataset/ori_500/bar_64.png +0 -0
  12. ChartMimic/dataset/ori_500/bar_65.png +0 -0
  13. ChartMimic/dataset/ori_500/bar_65.py +128 -0
  14. ChartMimic/dataset/ori_500/bar_67.png +0 -0
  15. ChartMimic/dataset/ori_500/bar_72.png +0 -0
  16. ChartMimic/dataset/ori_500/bar_73.png +0 -0
  17. ChartMimic/dataset/ori_500/bar_76.png +0 -0
  18. ChartMimic/dataset/ori_500/bar_77.png +0 -0
  19. ChartMimic/dataset/ori_500/bar_89.png +0 -0
  20. ChartMimic/dataset/ori_500/bar_89.py +53 -0
  21. ChartMimic/dataset/ori_500/bar_98.png +0 -0
  22. ChartMimic/dataset/ori_500/bar_98.py +91 -0
  23. ChartMimic/dataset/ori_500/bar_99.png +0 -0
  24. ChartMimic/dataset/ori_500/bar_99.py +68 -0
  25. ChartMimic/dataset/ori_500/box_13.py +64 -0
  26. ChartMimic/dataset/ori_500/box_21.png +0 -0
  27. ChartMimic/dataset/ori_500/errorbar_19.py +76 -0
  28. ChartMimic/dataset/ori_500/errorbar_28.py +82 -0
  29. ChartMimic/dataset/ori_500/errorbar_29.py +83 -0
  30. ChartMimic/dataset/ori_500/errorbar_8.py +88 -0
  31. ChartMimic/dataset/ori_500/errorbar_9.py +64 -0
  32. ChartMimic/dataset/ori_500/errorpoint_1.py +66 -0
  33. ChartMimic/dataset/ori_500/errorpoint_4.py +72 -0
  34. ChartMimic/dataset/ori_500/errorpoint_5.py +77 -0
  35. ChartMimic/dataset/ori_500/errorpoint_9.png +0 -0
  36. ChartMimic/dataset/ori_500/graph_2.py +50 -0
  37. ChartMimic/dataset/ori_500/graph_3.py +35 -0
  38. ChartMimic/dataset/ori_500/hist_15.py +57 -0
  39. ChartMimic/dataset/ori_500/hist_4.py +91 -0
  40. ChartMimic/dataset/ori_500/hist_5.py +53 -0
  41. ChartMimic/dataset/ori_500/line_12.py +103 -0
  42. ChartMimic/dataset/ori_500/line_18.py +105 -0
  43. ChartMimic/dataset/ori_500/line_19.py +64 -0
  44. ChartMimic/dataset/ori_500/line_26.py +100 -0
  45. ChartMimic/dataset/ori_500/line_28.py +70 -0
  46. ChartMimic/dataset/ori_500/line_29.py +70 -0
  47. ChartMimic/dataset/ori_500/line_38.py +67 -0
  48. ChartMimic/dataset/ori_500/line_40.png +0 -0
  49. ChartMimic/dataset/ori_500/line_41.png +0 -0
  50. ChartMimic/dataset/ori_500/line_42.png +0 -0
ChartMimic/dataset/ori_500/3d_10.png ADDED
ChartMimic/dataset/ori_500/area_1.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data for plotting
10
+ x = [1, 2, 3, 4, 5]
11
+ y1 = [18, 24, 27, 29, 29.5]
12
+ y2 = [12, 17, 21, 23, 24]
13
+ y3 = [6, 10, 12, 14, 15]
14
+ y4 = [5, 6, 7, 8, 8.5]
15
+
16
+ # Labels for legend
17
+ label_activity_net_mIoU = "ActivityNet mIoU"
18
+ label_breakfast_mof = "Breakfast MoF"
19
+ label_activity_net_cider = "ActivityNet CIDEr"
20
+ label_qvhighlights_map = "QVHighlights mAP"
21
+
22
+ # Plot limits
23
+ xlim_values = (1, 5)
24
+ ylim_values = (0, 35)
25
+
26
+ # Axis labels
27
+ xlabel_values = ["10K", "50K", "1M", "5M", "10M"]
28
+ ylabel_values = [0, 10, 20, 30, 34]
29
+
30
+ # Axis ticks
31
+ xticks_values = x
32
+ yticks_values = [0, 10, 20, 30, 34]
33
+
34
+ # Horizontal line value
35
+ axhline_value = 30
36
+
37
+ # ===================
38
+ # Part 3: Plot Configuration and Rendering
39
+ # ===================
40
+ # Plotting the data
41
+ plt.figure(figsize=(9, 8)) # Adjusting figure size to match original image dimensions
42
+ plt.plot(
43
+ x,
44
+ y1,
45
+ "o-",
46
+ clip_on=False,
47
+ zorder=10,
48
+ markerfacecolor="#eec7bb",
49
+ markeredgecolor="#d77659",
50
+ markersize=12,
51
+ color="#d77659",
52
+ label=label_activity_net_mIoU,
53
+ )
54
+ plt.plot(
55
+ x,
56
+ y2,
57
+ "o-",
58
+ clip_on=False,
59
+ zorder=10,
60
+ markerfacecolor="#f5dbc3",
61
+ markeredgecolor="#e8a66c",
62
+ markersize=12,
63
+ color="#e8a66c",
64
+ label=label_breakfast_mof,
65
+ )
66
+ plt.plot(
67
+ x,
68
+ y3,
69
+ "o-",
70
+ clip_on=False,
71
+ zorder=10,
72
+ markerfacecolor="#b4d7d1",
73
+ markeredgecolor="#509b8d",
74
+ markersize=12,
75
+ color="#509b8d",
76
+ label=label_activity_net_cider,
77
+ )
78
+ plt.plot(
79
+ x,
80
+ y4,
81
+ "o-",
82
+ clip_on=False,
83
+ zorder=10,
84
+ markerfacecolor="#abb5ba",
85
+ markeredgecolor="#2e4552",
86
+ markersize=12,
87
+ color="#2e4552",
88
+ label=label_qvhighlights_map,
89
+ )
90
+
91
+ # Filling the area under the curves
92
+ plt.fill_between(x, y1, y2, color="#eec7bb", alpha=1)
93
+ plt.fill_between(x, y2, y3, color="#f5dbc3", alpha=1)
94
+ plt.fill_between(x, y3, y4, color="#b4d7d1", alpha=1)
95
+ plt.fill_between(x, y4, color="#abb5ba", alpha=1)
96
+
97
+ # Adding a horizontal dashed line at y=axhline_value
98
+ plt.axhline(axhline_value, color="black", linestyle="dotted")
99
+
100
+ # Setting the x-axis、y-axis limits
101
+ plt.xlim(*xlim_values)
102
+ plt.ylim(*ylim_values)
103
+
104
+ # Setting the x-axis tick labels
105
+ plt.xticks(xticks_values, xlabel_values)
106
+ plt.yticks(yticks_values, ylabel_values)
107
+
108
+ # Adding a legend
109
+ plt.legend(loc="lower center", ncol=4, bbox_to_anchor=(0.5, -0.1), frameon=False)
110
+ plt.gca().tick_params(axis="both", which="both", length=0)
111
+
112
+ # ===================
113
+ # Part 4: Saving Output
114
+ # ===================
115
+ plt.tight_layout()
116
+ plt.savefig("area_1.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/area_4.py ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+ # ===================
10
+ # Part 2: Data Preparation
11
+ # ===================
12
+ # Data
13
+ n_aug = ["0", "0.125", "0.25", "0.5", "1", "2", "4", "8"]
14
+ content = np.array([1, 3, 6, 4, 2, 1, 0.5, 0.2])
15
+ organization = np.array([0.5, 1, 1.5, 2, 1.5, 1, 0.5, 0.25])
16
+ language = np.array([0, 0.5, 1, 2, 4, 3, 2, 1])
17
+
18
+ # Calculate cumulative values for stacked area chart
19
+ cumulative_content = content
20
+ cumulative_organization = cumulative_content + organization
21
+ cumulative_language = cumulative_organization + language
22
+
23
+ # Positions for the bars on the x-axis
24
+ ind = np.arange(len(n_aug))
25
+
26
+ # Variables for plot configuration
27
+ content_label = "Content"
28
+ organization_label = "Organization"
29
+ language_label = "Language"
30
+ xlim_values = (0, 7)
31
+ ylim_values = (0, 10)
32
+ xlabel_text = "n"
33
+ ylabel_text = "Performance Gain (%)"
34
+ title_text = "Cumulative Performance Gain by Augmentation Level"
35
+ yticks_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
36
+ legend_location = "upper center"
37
+ legend_fontsize = 12
38
+ legend_frameon = False
39
+ legend_shadow = True
40
+ legend_facecolor = "#ffffff"
41
+ legend_ncol = 3
42
+ legend_bbox_to_anchor = (0.5, 1.2)
43
+
44
+ # ===================
45
+ # Part 3: Plot Configuration and Rendering
46
+ # ===================
47
+ # Plot
48
+ fig, ax = plt.subplots(figsize=(8, 4)) # Adjusted for better aspect ratio
49
+ ax.fill_between(
50
+ n_aug, 0, cumulative_content, label=content_label, color="#0173b2", alpha=0.7
51
+ )
52
+ ax.fill_between(
53
+ n_aug,
54
+ cumulative_content,
55
+ cumulative_organization,
56
+ label=organization_label,
57
+ color="#de8f05",
58
+ alpha=0.7,
59
+ )
60
+ ax.fill_between(
61
+ n_aug,
62
+ cumulative_organization,
63
+ cumulative_language,
64
+ label=language_label,
65
+ color="#20a983",
66
+ alpha=0.7,
67
+ )
68
+
69
+ # Enhancing the plot with additional visuals
70
+ ax.spines["top"].set_visible(False)
71
+ ax.spines["right"].set_visible(False)
72
+ ax.spines["left"].set_visible(False)
73
+ ax.spines["bottom"].set_visible(False)
74
+ ax.set_yticks(yticks_values)
75
+ # Setting the x-axis and y-axis limits dynamically
76
+ ax.set_ylim(*ylim_values) # Ensure all data fits well
77
+ ax.set_xlim(*xlim_values)
78
+ # Labels, Title and Grid
79
+ ax.set_xlabel(xlabel_text, fontsize=14)
80
+ ax.set_ylabel(ylabel_text, fontsize=14)
81
+ ax.set_title(title_text, fontsize=16, y=1.2)
82
+ ax.tick_params(axis="both", which="both", color="gray")
83
+ # Custom legend
84
+ ax.legend(
85
+ loc=legend_location,
86
+ fontsize=legend_fontsize,
87
+ frameon=legend_frameon,
88
+ shadow=legend_shadow,
89
+ facecolor=legend_facecolor,
90
+ ncol=legend_ncol,
91
+ bbox_to_anchor=legend_bbox_to_anchor,
92
+ )
93
+
94
+ # Grid
95
+ ax.grid(True, linestyle="--", alpha=0.5, which="both")
96
+
97
+ # ===================
98
+ # Part 4: Saving Output
99
+ # ===================
100
+ # Adjusting layout to reduce white space
101
+ plt.tight_layout()
102
+ plt.savefig("area_4.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/area_5.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+ # ===================
10
+ # Part 2: Data Preparation
11
+ # ===================
12
+ year = [1950, 1960, 1970, 1980, 1990, 2000, 2010, 2018]
13
+ population_by_continent = {
14
+ "africa": [228, 284, 365, 477, 631, 814, 1044, 1275],
15
+ "americas": [943, 606, 540, 727, 840, 425, 519, 619],
16
+ "asia": [1394, 1686, 2120, 1625, 1202, 1714, 2169, 2560],
17
+ "europe": [220, 253, 276, 295, 310, 303, 294, 293],
18
+ "oceania": [200, 300, 340, 360, 280, 260, 320, 280],
19
+ }
20
+
21
+ # Extracted variables
22
+ legend_labels = list(population_by_continent.keys())
23
+ xlim_values = (1950, 2018)
24
+ ylim_values = (0, 6000)
25
+ xlabel_value = "Year"
26
+ ylabel_value = "Number of people (millions)"
27
+ title_value = "World population"
28
+ legend_loc = "upper center"
29
+ legend_reverse = False
30
+ legend_frameon = False
31
+ legend_ncol = 5
32
+ legend_bbox_to_anchor = (0.5, 1.08)
33
+ title_y_position = 1.08
34
+ colors = ["#b2e7aa", "#fae18f", "#d75949", "#f0906d", "#a1a8d6"]
35
+
36
+ # ===================
37
+ # Part 3: Plot Configuration and Rendering
38
+ # ===================
39
+ fig, ax = plt.subplots(figsize=(8, 6))
40
+ ax.stackplot(
41
+ year,
42
+ population_by_continent.values(),
43
+ labels=legend_labels,
44
+ alpha=0.8,
45
+ colors=colors,
46
+ )
47
+ ax.legend(
48
+ loc=legend_loc,
49
+ reverse=legend_reverse,
50
+ frameon=legend_frameon,
51
+ ncol=legend_ncol,
52
+ bbox_to_anchor=legend_bbox_to_anchor,
53
+ )
54
+ ax.set_xlim(*xlim_values)
55
+ ax.set_ylim(*ylim_values)
56
+ ax.set_title(title_value, y=title_y_position)
57
+ ax.set_xlabel(xlabel_value)
58
+ ax.set_ylabel(ylabel_value)
59
+ ax.tick_params(axis="both", which="both", length=0)
60
+
61
+ # ===================
62
+ # Part 4: Saving Output
63
+ # ===================
64
+ plt.tight_layout()
65
+ plt.savefig("area_5.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_48.png ADDED
ChartMimic/dataset/ori_500/bar_51.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data
10
+ professions = [
11
+ "Farmer",
12
+ "Scooter mechanic",
13
+ "Household management",
14
+ "Construction/Renovation",
15
+ "Gardening",
16
+ "Making Bricks",
17
+ "Carpenter",
18
+ "Baker",
19
+ "Crafting/knitting",
20
+ "Cleaning / laundry",
21
+ ]
22
+ number_of_videos = [2008, 2060, 2158, 2343, 2548, 2915, 3216, 3543, 4190, 5375]
23
+
24
+ # Axes Limits and Labels
25
+ xlabel_value = "Number of Videos"
26
+ title = "Number of Videos by Profession"
27
+
28
+ # ===================
29
+ # Part 3: Plot Configuration and Rendering
30
+ # ===================
31
+ # Create horizontal bar chart
32
+ plt.figure(figsize=(12, 8)) # Adjust figure size to match original image's dimensions
33
+ plt.barh(professions, number_of_videos, color="#685bc6") # Change bar color to purple
34
+ plt.xlabel(xlabel_value)
35
+ plt.title(title)
36
+
37
+ # Add data labels
38
+ for index, value in enumerate(number_of_videos):
39
+ plt.text(
40
+ value + 50, index, str(value), va="center", fontsize=10
41
+ ) # Adjust text position and font size
42
+
43
+ plt.yticks(rotation=45)
44
+
45
+ # ===================
46
+ # Part 4: Saving Output
47
+ # ===================
48
+ # Displaying the plot with tight layout to minimize white space
49
+ plt.tight_layout()
50
+ plt.savefig("bar_51.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_6.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Emotion labels
10
+ emotions = [
11
+ "Amusement",
12
+ "Unbothered",
13
+ "Sadness",
14
+ "Pride",
15
+ "Nervousness",
16
+ "Annoyance",
17
+ "Gratitude",
18
+ "Relief",
19
+ "Joy",
20
+ "Disapproval",
21
+ "Excitement",
22
+ "Delight",
23
+ "Oblivious",
24
+ "Embarrassment",
25
+ "Disappointment",
26
+ ]
27
+
28
+ # Approximate frequency values based on the image
29
+ frequencies = [
30
+ 2.1,
31
+ 2.7,
32
+ 3.0,
33
+ 3.5,
34
+ 3.5,
35
+ 3.8,
36
+ 4.0,
37
+ 4.0,
38
+ 6.0,
39
+ 6.0,
40
+ 6.0,
41
+ 6.6,
42
+ 6.7,
43
+ 7.0,
44
+ 7.6,
45
+ ]
46
+
47
+ xlabel = "Frequency (%)"
48
+ ylabel = "Emotion"
49
+ xticks = list(range(0, 9))
50
+ xlim = [0, 8.5]
51
+
52
+ # ===================
53
+ # Part 3: Plot Configuration and Rendering
54
+ # ===================
55
+ # Create horizontal bar chart
56
+ plt.figure(figsize=(8, 8)) # Adjust figure size
57
+ plt.barh(emotions, frequencies, color="#84ade3")
58
+
59
+ # Set x-axis limits
60
+ plt.xlim(xlim)
61
+
62
+ # Set x-axis ticks
63
+ plt.xticks(xticks)
64
+
65
+ # Set labels and title
66
+ plt.xlabel(xlabel)
67
+ plt.ylabel(ylabel)
68
+
69
+ # ===================
70
+ # Part 4: Saving Output
71
+ # ===================
72
+ # Show the plot with tight layout to minimize white space
73
+ plt.tight_layout()
74
+ plt.savefig("bar_6.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_60.png ADDED
ChartMimic/dataset/ori_500/bar_61.png ADDED
ChartMimic/dataset/ori_500/bar_63.png ADDED
ChartMimic/dataset/ori_500/bar_64.png ADDED
ChartMimic/dataset/ori_500/bar_65.png ADDED
ChartMimic/dataset/ori_500/bar_65.py ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import numpy as np
5
+
6
+ np.random.seed(0)
7
+
8
+ import matplotlib.pyplot as plt
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Define the categories and scores
14
+ categories = ["LLAMA-Default", "LLAMA-HAG", "Vicuna-Default", "Vicuna-HAG"]
15
+ num_scores = 4
16
+ score_range = (-3.5, -0.5)
17
+ scores_3 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist()
18
+ scores_5 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist()
19
+ scores_7 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist()
20
+ scores_10 = np.random.uniform(score_range[0], score_range[1], num_scores).tolist()
21
+
22
+ # The x locations for the groups
23
+ ind = np.arange(len(scores_3))
24
+
25
+ # The width of the bars
26
+ bar_width = 0.2
27
+
28
+ # Labels and Plot Types
29
+ label_3_Constraint_Words = "3 Constraint Words"
30
+ label_5_Constraint_Words = "5 Constraint Words"
31
+ label_7_Constraint_Words = "7 Constraint Words"
32
+ label_10_Constraint_Words = "10 Constraint Words"
33
+
34
+ # Axes Limits and Labels
35
+ xlabel_value = "Score"
36
+ ax_title = "Scores by group and constraint word count"
37
+
38
+ # ===================
39
+ # Part 3: Plot Configuration and Rendering
40
+ # ===================
41
+ # Create the figure and axes objects
42
+ fig, ax = plt.subplots(figsize=(10, 6))
43
+
44
+ # Plotting data
45
+ bars_3 = ax.barh(
46
+ ind - bar_width * 1.5,
47
+ scores_3,
48
+ bar_width,
49
+ label=label_3_Constraint_Words,
50
+ color="salmon",
51
+ )
52
+ bars_5 = ax.barh(
53
+ ind - bar_width * 0.5,
54
+ scores_5,
55
+ bar_width,
56
+ label=label_5_Constraint_Words,
57
+ color="skyblue",
58
+ )
59
+ bars_7 = ax.barh(
60
+ ind + bar_width * 0.5,
61
+ scores_7,
62
+ bar_width,
63
+ label=label_7_Constraint_Words,
64
+ color="coral",
65
+ )
66
+ bars_10 = ax.barh(
67
+ ind + bar_width * 1.5,
68
+ scores_10,
69
+ bar_width,
70
+ label=label_10_Constraint_Words,
71
+ color="lightblue",
72
+ )
73
+
74
+ # Adding text inside the bars
75
+ for i, (score_3, score_5, score_7, score_10) in enumerate(
76
+ zip(scores_3, scores_5, scores_7, scores_10)
77
+ ):
78
+ ax.text(
79
+ score_3,
80
+ i - bar_width * 1.5,
81
+ f"{score_3:.1f}",
82
+ va="center",
83
+ ha="right",
84
+ color="black",
85
+ )
86
+ ax.text(
87
+ score_5,
88
+ i - bar_width * 0.5,
89
+ f"{score_5:.1f}",
90
+ va="center",
91
+ ha="right",
92
+ color="black",
93
+ )
94
+ ax.text(
95
+ score_7,
96
+ i + bar_width * 0.5,
97
+ f"{score_7:.1f}",
98
+ va="center",
99
+ ha="right",
100
+ color="black",
101
+ )
102
+ ax.text(
103
+ score_10,
104
+ i + bar_width * 1.5,
105
+ f"{score_10:.1f}",
106
+ va="center",
107
+ ha="right",
108
+ color="black",
109
+ )
110
+
111
+ # Adding labels, title, and custom x-axis tick labels, etc.
112
+ ax.set_xlabel(xlabel_value)
113
+ ax.set_title(ax_title)
114
+ ax.set_yticks(ind)
115
+ ax.set_yticklabels(categories)
116
+ ax.legend()
117
+
118
+ # Invert y-axis to have the first entry at the top
119
+ plt.gca().invert_yaxis()
120
+
121
+ # Show grid lines for x-axis
122
+ ax.xaxis.grid(True)
123
+
124
+ # ===================
125
+ # Part 4: Saving Output
126
+ # ===================
127
+ plt.tight_layout()
128
+ plt.savefig("bar_65.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_67.png ADDED
ChartMimic/dataset/ori_500/bar_72.png ADDED
ChartMimic/dataset/ori_500/bar_73.png ADDED
ChartMimic/dataset/ori_500/bar_76.png ADDED
ChartMimic/dataset/ori_500/bar_77.png ADDED
ChartMimic/dataset/ori_500/bar_89.png ADDED
ChartMimic/dataset/ori_500/bar_89.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data for the bar chart
10
+ superfamilies = range(1, 11)
11
+ accuracies = [0.9, 0.83, 0.86, 0.84, 0.7, 0.85, 0.93, 0.89, 0.88, 1.0]
12
+ accuracies2 = [0.3, 0.5, 0.8, 0.6, 0.4, 0.65, 0.43, 0.69, 0.58, 1.0]
13
+ accuracies3 = [0.7, 0.6, 0.5, 0.7, 0.7, 0.64, 0.76, 0.56, 0.38, 1.0]
14
+ xlabel = "Top-10 superfamilies in training dataset"
15
+ ylabel1 = "Accuracy"
16
+ ylabel2 = "Recall"
17
+ ylabel3 = "Precision"
18
+ ylim = [0.0, 1.1]
19
+ yticks = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
20
+ yline = 0.6
21
+
22
+ # ===================
23
+ # Part 3: Plot Configuration and Rendering
24
+ # ===================
25
+ # Create the bar chart
26
+ fig, axes = plt.subplots(
27
+ 3, 1, figsize=(10, 6), sharex=True
28
+ ) # Adjusting figure size to match the original image's dimensions
29
+ axes[0].bar(superfamilies, accuracies, color="#7fa9cc")
30
+ axes[1].bar(superfamilies, accuracies2, color="#e39c90")
31
+ axes[2].bar(superfamilies, accuracies3, color="#af86ce")
32
+
33
+ # Add a horizontal line for the average accuracy
34
+ axes[0].axhline(y=yline, color="red", linestyle="--")
35
+
36
+ # Add labels and title
37
+ plt.xlabel(xlabel)
38
+ axes[0].set_ylabel(ylabel1)
39
+ axes[1].set_ylabel(ylabel2)
40
+ axes[2].set_ylabel(ylabel3)
41
+
42
+ # Set y-axis limits
43
+ plt.ylim(0.0, 1.1)
44
+ # Set x-axis, y-axis ticks
45
+ plt.xticks(superfamilies)
46
+ plt.yticks([0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
47
+
48
+ # ===================
49
+ # Part 4: Saving Output
50
+ # ===================
51
+ # Displaying the plot with tight layout to minimize white space
52
+ plt.tight_layout()
53
+ plt.savefig("bar_89.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_98.png ADDED
ChartMimic/dataset/ori_500/bar_98.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Data
14
+ labels = [
15
+ "Model A",
16
+ "Model B",
17
+ "Model C",
18
+ "Model D",
19
+ "Model E",
20
+ "Model F",
21
+ "Model G",
22
+ "Model H",
23
+ "Model I",
24
+ ]
25
+ non_aggregation = np.random.rand(9) * 100
26
+ aggregation = np.random.rand(9) * 100
27
+
28
+ datalabels = ["Contrastive Search", "Beam Search"]
29
+ ylabel = "Scores"
30
+ title = "Performance Comparison by Model"
31
+ ylim = [0, 120]
32
+
33
+ x = np.arange(len(labels)) # the label locations
34
+ width = 0.35 # the width of the bars
35
+
36
+ legendtitle = "Methods"
37
+
38
+ # ===================
39
+ # Part 3: Plot Configuration and Rendering
40
+ # ===================
41
+ # Plotting
42
+ fig, ax = plt.subplots(figsize=(10, 6)) # Adjust the size accordingly
43
+ rects1 = ax.bar(
44
+ x - width / 2,
45
+ non_aggregation,
46
+ width,
47
+ label="Contrastive Search",
48
+ color="#69b3a2",
49
+ hatch="/",
50
+ )
51
+ rects2 = ax.bar(
52
+ x + width / 2, aggregation, width, label="Beam Search", color="#d98763", hatch="\\"
53
+ )
54
+
55
+ # Add some text for labels, title and custom x-axis tick labels, etc.
56
+ ax.set_ylabel(ylabel)
57
+ ax.set_title(title)
58
+ ax.set_xticks(x)
59
+ ax.set_xticklabels(labels, rotation=0)
60
+ ax.set_ylim(ylim)
61
+ ax.set_xlim(-1, len(labels))
62
+
63
+ # Adding the values on top of the bars
64
+ for rect in rects1 + rects2:
65
+ height = rect.get_height()
66
+ ax.annotate(
67
+ f"{height:.1f}",
68
+ xy=(rect.get_x() + rect.get_width() / 2, height),
69
+ xytext=(0, 3), # 3 points vertical offset
70
+ textcoords="offset points",
71
+ ha="center",
72
+ va="bottom",
73
+ )
74
+
75
+ # Custom grid
76
+ ax.grid(axis="y", color="gray", linestyle="--", linewidth=0.7, alpha=0.7)
77
+ ax.set_axisbelow(True)
78
+
79
+ # Hide the ticks
80
+ ax.tick_params(axis="both", which="both", length=0)
81
+
82
+ # Hide the right and top spines
83
+ ax.spines["right"].set_visible(False)
84
+ ax.spines["top"].set_visible(False)
85
+ ax.legend(title=legendtitle)
86
+
87
+ # ===================
88
+ # Part 4: Saving Output
89
+ # ===================
90
+ plt.tight_layout()
91
+ plt.savefig("bar_98.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/bar_99.png ADDED
ChartMimic/dataset/ori_500/bar_99.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Create traffic data
14
+ data = np.array(
15
+ [
16
+ [150, 180, 75, 90, 80], # Traffic flow (in thousands of vehicles per day)
17
+ [2.5, 2.0, 1.5, 2.0, 2.8], # Accident rate (accidents per 100,000 vehicles)
18
+ [60, 55, 70, 65, 72], # Public transport usage (% of population)
19
+ [80, 75, 90, 85, 88], # Road conditions (road quality index out of 100)
20
+ [85, 80, 75, 90, 88], # Public satisfaction (satisfaction score out of 100)
21
+ ]
22
+ )
23
+ categories = [
24
+ "Traffic Flow",
25
+ "Accident Rate",
26
+ "Public Transport Usage",
27
+ "Road Conditions",
28
+ "Public Satisfaction",
29
+ ]
30
+
31
+ titles = ["Dataset 1", "Dataset 2", "Dataset 3", "Dataset 4"]
32
+
33
+ # ===================
34
+ # Part 3: Plot Configuration and Rendering
35
+ # ===================
36
+ fig, axs = plt.subplots(2, 2, figsize=(10, 8)) # Creating a 2x2 grid of subplots
37
+
38
+ colors = plt.get_cmap("Pastel2")(np.linspace(0.15, 0.85, data.shape[0]))
39
+ bar_width = 0.5 # Width of the bars
40
+
41
+
42
+ # Function to plot a bar chart in a specific subplot
43
+ def plot_bars(ax, data, categories, color, title):
44
+ bars = ax.bar(np.arange(len(categories)), data, color=color, width=bar_width)
45
+ ax.set_title(title)
46
+ ax.set_xticks(np.arange(len(categories)))
47
+ ax.set_xticklabels(categories, rotation=45)
48
+ for bar in bars:
49
+ yval = bar.get_height()
50
+ ax.text(
51
+ bar.get_x() + bar.get_width() / 2.0,
52
+ yval,
53
+ round(yval, 1),
54
+ va="top",
55
+ ha="center",
56
+ ) # Annotate bars
57
+
58
+
59
+ # Plot data on each subplot
60
+ for i, ax in enumerate(axs.flat):
61
+ plot_bars(ax, data[i], categories, colors[i], titles[i])
62
+
63
+ # ===================
64
+ # Part 4: Saving Output
65
+ # ===================
66
+ # Adjust layout to prevent overlap
67
+ fig.tight_layout()
68
+ plt.savefig("bar_99.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/box_13.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Sample data to mimic the boxplot in the picture
14
+ data = [
15
+ np.random.normal(0.825, 0.02, 100),
16
+ np.random.normal(0.850, 0.03, 100),
17
+ np.random.normal(0.840, 0.025, 100),
18
+ np.random.normal(0.860, 0.015, 100),
19
+ np.random.normal(0.855, 0.02, 100),
20
+ ]
21
+
22
+ labels = ["SQL-Only", "PoT", "IC-LP", "DAIL", "IC-LP+PoT"]
23
+ ylabel = "Execution Accuracy"
24
+ ylim = [0.725, 0.925]
25
+ yticks = np.arange(0.750, 0.901, 0.025)
26
+
27
+
28
+ # ===================
29
+ # Part 3: Plot Configuration and Rendering
30
+ # ===================
31
+ # Create the boxplot
32
+ fig, ax = plt.subplots(
33
+ figsize=(6, 5)
34
+ ) # Adjusting figure size as per the dimensions provided
35
+ bp = ax.boxplot(
36
+ data,
37
+ labels=labels,
38
+ patch_artist=True,
39
+ boxprops=dict(facecolor="#549e9a", color="black"),
40
+ medianprops=dict(color="black"),
41
+ whiskerprops=dict(color="black", linestyle="-"),
42
+ capprops=dict(color="black", linestyle="-"),
43
+ )
44
+
45
+ # Remove outliers
46
+ for flier in bp["fliers"]:
47
+ flier.set(marker="", color="black")
48
+
49
+ # Set the y-axis range and tick labels
50
+ ax.set_ylim(ylim)
51
+ ax.set_yticks(yticks)
52
+ # Set the y-axis label
53
+ ax.set_ylabel(ylabel, fontsize=12)
54
+
55
+ # Set the tick label size
56
+ ax.tick_params(axis="both", which="major", labelsize=10)
57
+ plt.xticks(rotation=45)
58
+
59
+ # ===================
60
+ # Part 4: Saving Output
61
+ # ===================
62
+ # Displaying the plot with tight layout to minimize white space
63
+ plt.tight_layout()
64
+ plt.savefig("box_13.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/box_21.png ADDED
ChartMimic/dataset/ori_500/errorbar_19.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Data representing social statistics for three different cities
14
+ categories = ["Detroit", "Philadelphia", "Baltimore"]
15
+ metrics = [
16
+ "Crime Rate",
17
+ "Happiness Index",
18
+ "Social Security Coverage",
19
+ "Political Participation",
20
+ ]
21
+ performance = np.array(
22
+ [
23
+ [50, 70, 90, 80],
24
+ [60, 80, 85, 75],
25
+ [40, 75, 95, 85],
26
+ ]
27
+ )
28
+ errors = np.array(
29
+ [
30
+ [5, 6, 9, 6],
31
+ [6, 7, 8, 7],
32
+ [8, 9, 6, 8],
33
+ ]
34
+ )
35
+ ylim = [30, 100]
36
+ ylabel = "Percentage"
37
+
38
+ # ===================
39
+ # Part 3: Plot Configuration and Rendering
40
+ # ===================
41
+ # Figure size to match a 3x1 subplot layout
42
+ fig, axes = plt.subplots(3, 1, figsize=(10, 9), sharex=True)
43
+ # Colors, choosing a different palette to differentiate the plots
44
+ colors = ["#8e44ad", "#3498db", "#e74c3c", "#f1c40f"]
45
+
46
+ # Plotting bars
47
+ for i, ax in enumerate(axes):
48
+ for j, metric in enumerate(metrics):
49
+ ax.bar(
50
+ j,
51
+ performance[i, j],
52
+ width=0.8,
53
+ color=colors[j],
54
+ yerr=errors[i, j],
55
+ capsize=0,
56
+ label=metric if i == 0 else "",
57
+ )
58
+
59
+ # Setting x-axis labels, y-axis limits, and titles
60
+ ax.set_xticks(range(len(metrics)))
61
+ ax.set_xticklabels(metrics, rotation=45)
62
+ ax.set_ylim(ylim)
63
+ ax.set_xlabel(f"({chr(97+i)}) {categories[i]}")
64
+ ax.set_ylabel(ylabel)
65
+ ax.yaxis.grid(True)
66
+ ax.set_axisbelow(True)
67
+
68
+ # Adding a legend outside of the plot on top
69
+ fig.legend(loc="upper center", bbox_to_anchor=(0.5, 1.05), ncol=len(metrics))
70
+
71
+ # ===================
72
+ # Part 4: Saving Output
73
+ # ===================
74
+ # Adjusting layout to prevent overlap and ensure labels are visible
75
+ plt.tight_layout()
76
+ plt.savefig("errorbar_19.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorbar_28.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+ import matplotlib.colors as mcolors
10
+
11
+ # ===================
12
+ # Part 2: Data Preparation
13
+ # ===================
14
+ # Data for environmental factors affecting plant growth
15
+ categories = [
16
+ "Sunlight",
17
+ "Water Quality",
18
+ "Soil pH",
19
+ "Fertilizer",
20
+ "Temperature",
21
+ "Pesticides",
22
+ "CO2 Levels",
23
+ "Plant Variety",
24
+ "Planting Density",
25
+ "Watering Frequency",
26
+ ]
27
+ values = [0.18, 0.15, 0.12, 0.09, 0.06, 0.03, -0.06, -0.03, -0.02, -0.03]
28
+ errors = [0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01]
29
+
30
+ min_val = min(values) - 0.1
31
+ max_val = max(values) + 0.1
32
+
33
+
34
+ # Normalizing function to convert values to a 0-1 range for color scaling
35
+ def normalize(value, min_val, max_val):
36
+ return (value - min_val) / (max_val - min_val)
37
+
38
+
39
+ # Determine color based on normalized value
40
+ def get_color(value):
41
+ norm_value = normalize(value, min_val, max_val)
42
+ green_base = np.array(mcolors.to_rgb("#6a8347"))
43
+ # Create a color that ranges from very light green to the base green
44
+ return mcolors.to_hex((1 - green_base) * (1 - norm_value) + green_base)
45
+
46
+
47
+ colors = [get_color(value) for value in values]
48
+
49
+ # Axes Limits and Labels
50
+ ylabel_value = "Environmental Factors"
51
+ xlabel_value = "Impact on Plant Growth (Δ to control)"
52
+
53
+ # ===================
54
+ # Part 3: Plot Configuration and Rendering
55
+ # ===================
56
+ # Create figure and axis
57
+ fig, ax = plt.subplots(figsize=(10, 8))
58
+
59
+ # Horizontal bar chart
60
+ bars = ax.barh(
61
+ categories, values, xerr=errors, color=colors, capsize=3, edgecolor="none"
62
+ )
63
+ ax.set_ylabel(ylabel_value)
64
+ ax.set_xlabel(xlabel_value)
65
+
66
+ # Set y-axis limits and x-axis limits
67
+ ax.set_xlim(min_val, max_val) # Adjust limits to encompass errors
68
+
69
+ # Remove top and right spines for a cleaner look
70
+ ax.spines["top"].set_visible(False)
71
+ ax.spines["right"].set_visible(False)
72
+
73
+ # Customize grid lines
74
+ ax.xaxis.grid(True, linestyle="--", which="major", color="gray", alpha=0.6)
75
+ ax.set_axisbelow(True)
76
+
77
+ # ===================
78
+ # Part 4: Saving Output
79
+ # ===================
80
+ # Adjust layout to prevent clipping of ylabel
81
+ plt.tight_layout()
82
+ plt.savefig("errorbar_28.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorbar_29.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Updated Urban Transportation Data for three major cities
14
+ metrics = ["Traffic Volume", "Public Transit", "Accident Rate"]
15
+ values = np.array(
16
+ [
17
+ [220, 180, 220], # New York
18
+ [150, 120, 130], # Los Angeles
19
+ [130, 160, 110], # Chicago
20
+ ]
21
+ )
22
+
23
+ # Updated asymmetric error values, now more proportionate to the data scale
24
+ errors = np.array(
25
+ [
26
+ [[25, 20], [15, 15], [25, 20]], # Errors for New York (lower, upper)
27
+ [[20, 15], [10, 15], [20, 10]], # Errors for Los Angeles
28
+ [[15, 20], [15, 10], [15, 15]], # Errors for Chicago
29
+ ]
30
+ )
31
+
32
+ # Creating subplots for each city
33
+ cities = ["New York", "Los Angeles", "Chicago"]
34
+
35
+ ylabel = "Metric Values"
36
+ ylim = [80, 280]
37
+
38
+ # ===================
39
+ # Part 3: Plot Configuration and Rendering
40
+ # ===================
41
+ fig, axs = plt.subplots(1, 3, figsize=(10, 4)) # Compact and square figure layout
42
+
43
+
44
+ # Function to plot each city's data
45
+ def plot_city_data(ax, errors, city_index, city_name):
46
+ x = np.arange(len(metrics)) # the label locations
47
+ bar_colors = ["#6a8347", "#377eb8", "#d62728"]
48
+ barerrors = np.array(errors).T[:, :, city_index]
49
+ bars = ax.bar(x, values[city_index], yerr=barerrors, color=bar_colors, capsize=5)
50
+ for bar, lower_error, upper_error in zip(bars, barerrors[0], barerrors[1]):
51
+ # Position for lower error text
52
+ ax.text(
53
+ bar.get_x() + bar.get_width() / 2,
54
+ bar.get_height() - lower_error - 15,
55
+ f"-{lower_error}",
56
+ va="bottom",
57
+ ha="center",
58
+ color="black",
59
+ )
60
+ # Position for upper error text
61
+ ax.text(
62
+ bar.get_x() + bar.get_width() / 2,
63
+ bar.get_height() + upper_error + 3,
64
+ f"+{upper_error}",
65
+ ha="center",
66
+ color="black",
67
+ )
68
+
69
+ ax.set_title(city_name)
70
+ ax.set_xticks(x)
71
+ ax.set_xticklabels(metrics, rotation=90)
72
+ ax.set_ylabel(ylabel)
73
+ ax.set_ylim(ylim) # Uniform scale for all charts
74
+
75
+
76
+ for i, city in enumerate(cities):
77
+ plot_city_data(axs[i], errors, i, city)
78
+
79
+ # ===================
80
+ # Part 4: Saving Output
81
+ # ===================
82
+ plt.tight_layout()
83
+ plt.savefig("errorbar_29.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorbar_8.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Data (estimated from the image)
14
+ models = [
15
+ "BERT",
16
+ "RoBERTa",
17
+ "DistilBERT",
18
+ "XLNet",
19
+ "Electra",
20
+ "Albert",
21
+ "BART",
22
+ "DeBERTa",
23
+ "Llama2",
24
+ ]
25
+ ground_truth_accuracy = [50, 55, 60, 65, 40, 30, 70, 45, 35]
26
+ weak_labels_accuracy = [45, 50, 55, 60, 35, 25, 65, 40, 30]
27
+ error = [10, 8, 12, 10, 5, 7, 8, 10, 5]
28
+ labels = ["Ground-truth labels", "Weak labels"]
29
+ ylabel = "Accuracy (%)"
30
+ ylim = [0, 80]
31
+ yticks = np.arange(0, 71, 10)
32
+
33
+
34
+ # ===================
35
+ # Part 3: Plot Configuration and Rendering
36
+ # ===================
37
+ fig = plt.subplots(figsize=(10, 3))
38
+ # Bar width
39
+ bar_width = 0.35
40
+
41
+ # X position of bars
42
+ r1 = np.arange(len(ground_truth_accuracy))
43
+ r2 = [x + bar_width for x in r1]
44
+
45
+ # Create bars
46
+ plt.bar(
47
+ r1,
48
+ ground_truth_accuracy,
49
+ color="#d47e6d",
50
+ width=bar_width,
51
+ label=labels[0],
52
+ yerr=error,
53
+ capsize=7,
54
+ )
55
+ plt.bar(
56
+ r2,
57
+ weak_labels_accuracy,
58
+ color="#76a4c5",
59
+ width=bar_width,
60
+ label=labels[1],
61
+ yerr=error,
62
+ capsize=7,
63
+ )
64
+
65
+ # Add xticks on the middle of the group bars
66
+ plt.xticks([r + bar_width / 2 for r in range(len(ground_truth_accuracy))], models)
67
+
68
+ # Create legend & Show graphic
69
+ plt.ylabel(ylabel)
70
+ plt.legend(frameon=False, loc="upper right") # Remove legend background
71
+
72
+ # Set background color and grid
73
+ plt.gca().set_facecolor("#e5e5e5")
74
+ plt.grid(color="white", linestyle="-", linewidth=0.25, axis="both")
75
+ plt.gca().set_axisbelow(True)
76
+
77
+ # Set y-axis limits
78
+ plt.ylim(ylim)
79
+ plt.yticks(yticks)
80
+
81
+ for spine in plt.gca().spines.values():
82
+ spine.set_visible(False)
83
+
84
+ # ===================
85
+ # Part 4: Saving Output
86
+ # ===================
87
+ plt.tight_layout()
88
+ plt.savefig("errorbar_8.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorbar_9.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Categories and values (estimated from the image)
10
+ categories = [
11
+ "Syntax: Tagging, Chunking and Parsing",
12
+ "Discourse and Pragmatics",
13
+ "Information Extraction",
14
+ "Machine Learning for NLP",
15
+ "Information Retrieval and Text Mining",
16
+ "Phonology, Morphology and Word Segmentation",
17
+ "Computational Social Science and Social Media",
18
+ ][::-1]
19
+ values = [-3.20, -3.1, -3.00, -2.90, -2.80, -2.70, -2.60][::-1]
20
+ error = [0.1, 0.15, 0.3, 0.25, 0.2, 0.1, 0.05]
21
+ xlabel = "A"
22
+ ylabel = "Categories"
23
+ title = "Your Chart Title Here"
24
+ xlim = [-3.5, -1.5]
25
+ # ===================
26
+ # Part 3: Plot Configuration and Rendering
27
+ # ===================
28
+ # Create horizontal bar chart
29
+ fig, ax = plt.subplots(figsize=(8, 8)) # Adjust figure size
30
+ bars = ax.barh(
31
+ categories,
32
+ values,
33
+ color="#c5b3d6",
34
+ edgecolor="white",
35
+ height=0.5,
36
+ xerr=error,
37
+ capsize=0,
38
+ )
39
+
40
+ # Set labels and title (if any)
41
+ ax.set_xlabel(xlabel)
42
+ ax.set_ylabel(ylabel)
43
+ ax.set_title(title)
44
+
45
+ # Invert y-axis to match the image
46
+ ax.invert_yaxis()
47
+
48
+ # Set x-axis range to match the reference image
49
+ ax.set_xlim(xlim)
50
+
51
+ # Remove grid lines
52
+ ax.xaxis.grid(False)
53
+ ax.spines["top"].set_visible(False)
54
+ ax.spines["right"].set_visible(False)
55
+
56
+ # Set background color to white
57
+ ax.set_facecolor("white")
58
+
59
+ # ===================
60
+ # Part 4: Saving Output
61
+ # ===================
62
+ # Displaying the plot with tight layout to minimize white space
63
+ plt.tight_layout()
64
+ plt.savefig("errorbar_9.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorpoint_1.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Sample data (replace with actual data)
14
+ categories = [
15
+ "Kashmir",
16
+ "Religion",
17
+ "Crime and Justice",
18
+ "CAA",
19
+ "Pulwama-Balakot",
20
+ "Politics",
21
+ ]
22
+ means = np.random.uniform(0.05, 0.15, len(categories))
23
+ std_devs = np.random.uniform(0.01, 0.05, len(categories))
24
+ dataset_mean = np.mean(means)
25
+
26
+ # Labels and Plot Types
27
+ label_Mean = "Mean"
28
+ label_Dataset_mean = "Dataset mean"
29
+
30
+ # Axes Limits and Labels
31
+ ylabel_value = "Shouting Fraction (Fraction of videos)"
32
+ ylim_values = [0.01, 0.18]
33
+
34
+ # ===================
35
+ # Part 3: Plot Configuration and Rendering
36
+ # ===================
37
+ # Create figure and axis
38
+ fig, ax = plt.subplots(figsize=(8, 5))
39
+
40
+ # Error bar plot
41
+ ax.errorbar(
42
+ categories,
43
+ means,
44
+ yerr=std_devs,
45
+ fmt="o",
46
+ color="blue",
47
+ ecolor="blue",
48
+ capsize=5,
49
+ label=label_Mean,
50
+ )
51
+
52
+ # Dataset mean line
53
+ ax.axhline(y=dataset_mean, color="grey", linestyle="--", label=label_Dataset_mean)
54
+
55
+ # Customizing the plot
56
+ ax.set_ylabel(ylabel_value)
57
+ ax.set_xticklabels(categories, rotation=45, ha="right")
58
+ ax.legend()
59
+ ax.set_ylim(ylim_values)
60
+
61
+ # ===================
62
+ # Part 4: Saving Output
63
+ # ===================
64
+ # Adjust layout to prevent clipping of tick-labels
65
+ plt.tight_layout()
66
+ plt.savefig("errorpoint_1.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorpoint_4.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data (example values, replace with actual data)
10
+ categories = [
11
+ "Education",
12
+ "Religion",
13
+ "Bollywood",
14
+ "Crime and Justice",
15
+ "Farmers Protest",
16
+ "Issue Politics",
17
+ ]
18
+ unique_speaker_mean = [10, 12, 11, 13, 14, 15] # Replace with actual mean values
19
+ unique_shouter_mean = [5, 6, 7, 6, 5, 4] # Replace with actual mean values
20
+ unique_speaker_error = [1, 1.5, 1, 1.5, 2, 1.5] # Replace with actual error values
21
+ unique_shouter_error = [
22
+ 0.5,
23
+ 0.75,
24
+ 0.5,
25
+ 0.75,
26
+ 1,
27
+ 0.75,
28
+ ] # Replace with actual error values
29
+ labels = ["Unique speaker count mean", "Unique shouter count mean"]
30
+ ylabel = "Number of speakers"
31
+ axlabel = "Dataset unique shouter count mean"
32
+ # ===================
33
+ # Part 3: Plot Configuration and Rendering
34
+ # ===================
35
+ # Plotting
36
+ fig, ax = plt.subplots(
37
+ figsize=(10, 6)
38
+ ) # Adjust the size to match the original image's dimensions
39
+ ax.errorbar(
40
+ categories,
41
+ unique_speaker_mean,
42
+ yerr=unique_speaker_error,
43
+ fmt="o",
44
+ color="blue",
45
+ label=labels[0],
46
+ )
47
+ ax.errorbar(
48
+ categories,
49
+ unique_shouter_mean,
50
+ yerr=unique_shouter_error,
51
+ fmt="o",
52
+ color="red",
53
+ label=labels[1],
54
+ )
55
+
56
+ # Customization
57
+ ax.set_ylabel(ylabel)
58
+ ax.set_xticklabels(categories, rotation=45, ha="right")
59
+ ax.axhline(
60
+ y=sum(unique_shouter_mean) / len(unique_shouter_mean),
61
+ color="grey",
62
+ linestyle="--",
63
+ label=axlabel,
64
+ )
65
+ ax.legend()
66
+
67
+ # ===================
68
+ # Part 4: Saving Output
69
+ # ===================
70
+ # Show plot
71
+ plt.tight_layout()
72
+ plt.savefig("errorpoint_4.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorpoint_5.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data for plotting
10
+ categories = [
11
+ "KASHMIR",
12
+ "COVID/LOCKDOWN",
13
+ "SPORTS",
14
+ "CHINA",
15
+ "PULWAMA-BALAKOT",
16
+ ] # Capitalized category labels
17
+ means = [0.22, 0.23, 0.18, 0.12, 0.05]
18
+ errors = [0.03, 0.02, 0.05, 0.06, 0.02]
19
+ downerrors = [0.01, 0.02, 0.03, 0.04, 0.05]
20
+ legendtitles = ["Dataset mean", "Mean"]
21
+ texttitle = "Dataset mean"
22
+ ylabel = "Female Face presence (Fraction of videos)"
23
+
24
+ # ===================
25
+ # Part 3: Plot Configuration and Rendering
26
+ # ===================
27
+ # Plotting the data
28
+ fig, ax = plt.subplots(
29
+ figsize=(8, 6)
30
+ ) # Adjusting figure size to match original image dimensions
31
+ ax.errorbar(
32
+ categories,
33
+ means,
34
+ yerr=[errors, downerrors],
35
+ fmt="o",
36
+ color="blue",
37
+ ecolor="blue",
38
+ capsize=5,
39
+ )
40
+
41
+ # Adding a legend with both "Mean" and "Dataset mean"
42
+ dataset_mean = 0.253
43
+ mean_line = ax.errorbar(
44
+ [], [], yerr=[], fmt="o", color="blue", ecolor="blue", capsize=5
45
+ )
46
+ dataset_mean_line = ax.axhline(
47
+ y=dataset_mean, color="gray", linestyle="--", linewidth=1
48
+ )
49
+ ax.legend(
50
+ [dataset_mean_line, mean_line],
51
+ legendtitles,
52
+ loc="upper right",
53
+ fancybox=True,
54
+ framealpha=1,
55
+ shadow=True,
56
+ borderpad=1,
57
+ )
58
+ # Adding a horizontal line for dataset mean and text annotation with a white background
59
+ ax.text(
60
+ 0.95,
61
+ dataset_mean,
62
+ texttitle,
63
+ va="center",
64
+ ha="right",
65
+ backgroundcolor="white",
66
+ transform=ax.get_yaxis_transform(),
67
+ )
68
+ # Setting labels
69
+ ax.set_ylabel(ylabel)
70
+ ax.set_title("")
71
+ plt.xticks(rotation=30)
72
+
73
+ # ===================
74
+ # Part 4: Saving Output
75
+ # ===================
76
+ plt.tight_layout()
77
+ plt.savefig("errorpoint_5.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/errorpoint_9.png ADDED
ChartMimic/dataset/ori_500/graph_2.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import networkx as nx
6
+ import numpy as np
7
+
8
+ np.random.seed(0)
9
+
10
+
11
+ # ===================
12
+ # Part 2: Data Preparation
13
+ # ===================
14
+ # Create a random graph
15
+ G = nx.random_geometric_graph(30, 0.3)
16
+
17
+ # Position the nodes based on their connections using a different layout algorithm
18
+ pos = nx.kamada_kawai_layout(
19
+ G
20
+ ) # This layout algorithm may produce a more spread-out layout
21
+
22
+ # Randomly select some edges to color blue
23
+ edges = list(G.edges())
24
+ blue_edges = np.random.choice(
25
+ len(edges), size=int(len(edges) * 0.3), replace=False
26
+ ) # 30% of the edges
27
+ blue_edges = [edges[i] for i in blue_edges]
28
+
29
+ # ===================
30
+ # Part 3: Plot Configuration and Rendering
31
+ # ===================
32
+ fig = plt.subplots(figsize=(8, 8))
33
+
34
+ # Draw the nodes
35
+ nx.draw_networkx_nodes(G, pos, node_size=200, node_color="pink")
36
+
37
+ # Draw the edges
38
+ nx.draw_networkx_edges(G, pos, alpha=0.3)
39
+
40
+ # Draw the selected edges in blue
41
+ nx.draw_networkx_edges(G, pos, edgelist=blue_edges, edge_color="#d0e2e8")
42
+
43
+ # Remove axis
44
+ plt.axis("off")
45
+
46
+ # ===================
47
+ # Part 4: Saving Output
48
+ # ===================
49
+ plt.tight_layout()
50
+ plt.savefig("graph_2.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/graph_3.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import networkx as nx
6
+
7
+ # ===================
8
+ # Part 2: Data Preparation
9
+ # ===================
10
+ # Create a cycle graph with 12 nodes
11
+ G = nx.cycle_graph(12)
12
+ weights = {edge: i + 1 for i, edge in enumerate(G.edges())}
13
+ nx.set_edge_attributes(G, weights, "weight")
14
+
15
+ pos = nx.spring_layout(G, iterations=200)
16
+
17
+ labels = {i: str(i) for i in range(12)}
18
+
19
+ # Draw edge labels
20
+ edge_labels = nx.get_edge_attributes(G, "weight")
21
+
22
+ # ===================
23
+ # Part 3: Plot Configuration and Rendering
24
+ # ===================
25
+ plt.figure(figsize=(10, 8))
26
+ nx.draw(G, pos, node_size=800, node_color="gold")
27
+ nx.draw_networkx_labels(G, pos, labels=labels)
28
+ nx.draw_networkx_edge_labels(G, pos, edge_labels=edge_labels)
29
+
30
+ # ===================
31
+ # Part 4: Saving Output
32
+ # ===================
33
+ # Show the plot
34
+ plt.tight_layout()
35
+ plt.savefig("graph_3.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/hist_15.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Generate normally distributed data
14
+ data = np.random.normal(loc=2.0, scale=1.0, size=10000)
15
+
16
+ # Axes Limits and Labels
17
+ title = "Histogram of Wind Speed Measurements"
18
+ xlabel_value = "Wind Speed (km/h)"
19
+ ylabel_value = "Number of Measurements"
20
+
21
+ # ===================
22
+ # Part 3: Plot Configuration and Rendering
23
+ # ===================
24
+ # Set the figure size
25
+ plt.figure(figsize=(8, 6))
26
+
27
+ # Enable the grid
28
+ plt.grid(True, linestyle="--", linewidth=0.5, alpha=0.7)
29
+
30
+ # Histogram of the data
31
+ n, bins, patches = plt.hist(data, bins=25, color="skyblue", edgecolor="blue", alpha=0.7)
32
+
33
+ # Highlight the median of the data
34
+ median = np.median(data)
35
+ plt.axvline(median, color="purple", linestyle="dashed", linewidth=2)
36
+
37
+ # Adjust the median text position to not overlap the bars when possible
38
+ median_text_position = max(n) * 0.9
39
+ for bin_edge, count in zip(bins, n):
40
+ if bin_edge > median and count < median_text_position:
41
+ # Place the text above the median position
42
+ median_text_position = count
43
+ break
44
+ plt.text(median + 0.5, median_text_position, f"Median: {median:.2f}", color="purple")
45
+
46
+ # Title and labels relevant to database statistics
47
+ plt.title(title)
48
+ plt.xlabel(xlabel_value)
49
+ plt.ylabel(ylabel_value)
50
+
51
+ # ===================
52
+ # Part 4: Saving Output
53
+ # ===================
54
+ # Adjust the layout
55
+ plt.tight_layout()
56
+
57
+ plt.savefig("hist_15.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/hist_4.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Sample data (replace with actual data)
14
+ center_data = np.random.normal(6, 2, 1000)
15
+ random_data = np.random.normal(1, 2, 1000)
16
+
17
+ # Define bins aligned for both histograms
18
+ bins = np.histogram(np.hstack((center_data, random_data)), bins=30)[1]
19
+ labels = ["Center", "Random"]
20
+ xlabel = "Distance Difference (Random vs. Center)"
21
+ ylabel = "Number of Examples"
22
+
23
+ # ===================
24
+ # Part 3: Plot Configuration and Rendering
25
+ # ===================
26
+ # Create figure and axis
27
+ fig, ax = plt.subplots(
28
+ figsize=(5, 3)
29
+ ) # Adjusted to match the original image's dimensions
30
+
31
+ # Calculate the histogram data for each set and plot them
32
+ ax.hist(
33
+ center_data,
34
+ bins=bins,
35
+ color="#f2a965",
36
+ edgecolor="#fdf460",
37
+ linewidth=1.2,
38
+ label=labels[0],
39
+ align="mid",
40
+ histtype="stepfilled",
41
+ alpha=0.7,
42
+ )
43
+ ax.hist(
44
+ random_data,
45
+ bins=bins,
46
+ color="#709dc6",
47
+ edgecolor="#ca3531",
48
+ linewidth=1.2,
49
+ label=labels[1],
50
+ align="mid",
51
+ histtype="stepfilled",
52
+ alpha=0.7,
53
+ )
54
+
55
+ # To show the overlapping areas, we plot the two histograms with transparency
56
+ ax.hist(
57
+ center_data,
58
+ bins=bins,
59
+ color="#f2a965",
60
+ edgecolor="#fdf460",
61
+ linewidth=1.2,
62
+ alpha=0.7,
63
+ align="mid",
64
+ histtype="stepfilled",
65
+ )
66
+ ax.hist(
67
+ random_data,
68
+ bins=bins,
69
+ color="#709dc6",
70
+ edgecolor="#ca3531",
71
+ linewidth=1.2,
72
+ alpha=0.7,
73
+ align="mid",
74
+ histtype="stepfilled",
75
+ )
76
+
77
+ # Set labels
78
+ ax.set_xlabel(xlabel)
79
+ ax.set_ylabel(ylabel)
80
+
81
+ # Add legend
82
+ ax.legend()
83
+
84
+ # ===================
85
+ # Part 4: Saving Output
86
+ # ===================
87
+ # Adjust layout
88
+ plt.tight_layout()
89
+
90
+ # Save the plot
91
+ plt.savefig("hist_4.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/hist_5.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ np.random.seed(0)
8
+
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Sample data to approximate the distribution in the image
14
+ data = np.random.gamma(shape=2.0, scale=1.0, size=10000)
15
+ data = data[data < 30] # Limiting the data to match the x-axis in the image
16
+ xlabel = "Number of Repetition"
17
+ ylabel = "Number of Clusters"
18
+ binslist = [30, 30]
19
+
20
+ # ===================
21
+ # Part 3: Plot Configuration and Rendering
22
+ # ===================
23
+ # Set the figure size to match the original image's dimensions
24
+ plt.figure(figsize=(4, 3))
25
+
26
+ # Show grid with some transparency
27
+ plt.grid(True, linestyle="-", linewidth=0.5, color="#000000", alpha=0.1)
28
+
29
+ # Create the histogram
30
+ plt.hist(data, bins=binslist[0], color="#dca684")
31
+
32
+ # Create the histogram with histtype='step' for edge-only bars
33
+ plt.hist(
34
+ data,
35
+ bins=binslist[1],
36
+ color="#dca684",
37
+ edgecolor="#d1885c",
38
+ histtype="step",
39
+ linewidth=1.2,
40
+ )
41
+
42
+ # Set the title and labels to match the image
43
+ plt.xlabel(xlabel)
44
+ plt.ylabel(ylabel)
45
+
46
+ # ===================
47
+ # Part 4: Saving Output
48
+ # ===================
49
+ # Adjust layout
50
+ plt.tight_layout()
51
+
52
+ # Display the plot
53
+ plt.savefig("hist_5.pdf", bbox_inches="tight")
ChartMimic/dataset/ori_500/line_12.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+
5
+ import matplotlib.pyplot as plt
6
+
7
+ # ===================
8
+ # Part 2: Data Preparation
9
+ # ===================
10
+ # Data for plotting
11
+ sample_ratio = [0.25, 0.50, 0.75, 1.00]
12
+ std_acc_512 = [0.07, 0.06, 0.01, 0.05]
13
+ std_acc_1024 = [0.055, 0.045, 0.04, 0.035]
14
+ std_acc_2048 = [0.03, 0.025, 0.02, 0.015]
15
+
16
+ # Extracted variables
17
+ line_label_512 = "MAXN=512"
18
+ line_label_1024 = "MAXN=1024"
19
+ line_label_2048 = "MAXN=2048"
20
+ xlim_values = (0.25, 1)
21
+ ylim_values = (0.00, 0.08)
22
+ xlabel_value = "Sample Ratio"
23
+ ylabel_value = "Std of ACC"
24
+ xticks_values = sample_ratio
25
+ yticks_values = None # Not explicitly set in the code
26
+ xtickslabel_fontsize = 14
27
+ ytickslabel_fontsize = 14
28
+ title_value = None # Not explicitly set in the code
29
+ axhline_value = None # Not explicitly set in the code
30
+ axvline_value = None # Not explicitly set in the code
31
+
32
+ # ===================
33
+ # Part 3: Plot Configuration and Rendering
34
+ # ===================
35
+ # Plotting the lines with increased marker size and line width
36
+ plt.figure(figsize=(8, 6))
37
+ plt.plot(
38
+ sample_ratio,
39
+ std_acc_512,
40
+ marker="*",
41
+ markersize=10,
42
+ linewidth=2,
43
+ color="#2ab34a",
44
+ label=line_label_512,
45
+ clip_on=False,
46
+ zorder=10,
47
+ )
48
+ plt.plot(
49
+ sample_ratio,
50
+ std_acc_1024,
51
+ marker="^",
52
+ markerfacecolor="white",
53
+ markersize=10,
54
+ linewidth=2,
55
+ markeredgecolor="#ee756e",
56
+ color="#ee756e",
57
+ clip_on=False,
58
+ zorder=10,
59
+ label=line_label_1024,
60
+ )
61
+ plt.plot(
62
+ sample_ratio,
63
+ std_acc_2048,
64
+ marker="o",
65
+ markerfacecolor="white",
66
+ markersize=10,
67
+ linewidth=2,
68
+ markeredgecolor="#4995c6",
69
+ color="#4995c6",
70
+ clip_on=False,
71
+ zorder=10,
72
+ label=line_label_2048,
73
+ )
74
+
75
+ # Setting the x-axis and y-axis limits
76
+ plt.ylim(*ylim_values) # Set y-axis to go from 0 to 7
77
+ plt.yticks(fontsize=ytickslabel_fontsize)
78
+ plt.xlim(*xlim_values) # Set y-axis to go from 0 to 7
79
+ # Set x-axis to show only the values in the sample_ratio list
80
+ plt.xticks(xticks_values, fontsize=xtickslabel_fontsize)
81
+
82
+ # Adding labels and title
83
+ plt.xlabel(xlabel_value, fontsize=18)
84
+ plt.ylabel(ylabel_value, fontsize=18)
85
+
86
+ # Adding legend with increased font size
87
+ plt.legend(
88
+ fontsize="large",
89
+ loc="upper center",
90
+ ncol=3,
91
+ frameon=False,
92
+ bbox_to_anchor=(0.5, 1.1),
93
+ )
94
+
95
+ # Adding grid
96
+ plt.grid(True, alpha=0.6)
97
+
98
+ # ===================
99
+ # Part 4: Saving Output
100
+ # ===================
101
+ # Adjusting layout to reduce white space
102
+ plt.tight_layout()
103
+ plt.savefig('line_12.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_18.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np; np.random.seed(0)
6
+
7
+
8
+ # ===================
9
+ # Part 2: Data Preparation
10
+ # ===================
11
+ # Sample data
12
+ iterations = np.array([0, 250, 500, 750, 1000, 1250, 1500, 1750, 2000])
13
+ gpt4_7b = np.array([0.1, 0.4, 0.7, 0.85, 0.9, 0.92, 0.93, 0.94, 0.95])
14
+ gpt4_7b_ft = np.array([0.05, 0.2, 0.35, 0.5, 0.6, 0.65, 0.7, 0.72, 0.73])
15
+ llama_7b = np.array([0.1, 0.45, 0.75, 0.88, 0.9, 0.91, 0.92, 0.93, 0.94])
16
+ llama_7b_ft = np.array([0.05, 0.25, 0.4, 0.55, 0.65, 0.7, 0.75, 0.77, 0.78])
17
+
18
+ # Axes Limits and Labels
19
+ xlabel_value = "Iterations"
20
+ ylabel_value = "Attack Success Rate"
21
+
22
+ # Labels
23
+ label_1 = "7B"
24
+ label_2 = "7B (Fine-tuned)"
25
+
26
+ # Titles
27
+ title_1 = "GPT-4 Evaluation"
28
+ title_2 = "Llama Guard Evaluation"
29
+
30
+
31
+ # ===================
32
+ # Part 3: Plot Configuration and Rendering
33
+ # ===================
34
+ # Set the figure size to match the original image's dimensions
35
+ plt.figure(figsize=(9, 4))
36
+
37
+ # First subplot
38
+ plt.subplot(1, 2, 1)
39
+ plt.plot(
40
+ iterations,
41
+ gpt4_7b,
42
+ marker="o",
43
+ color="#0a6ae1",
44
+ label=label_1,
45
+ markerfacecolor="#0a6ae1",
46
+ linewidth=2,
47
+ markersize=5,
48
+ )
49
+ plt.plot(
50
+ iterations,
51
+ gpt4_7b_ft,
52
+ marker="o",
53
+ color="#d75faa",
54
+ label=label_2,
55
+ markerfacecolor="#d75faa",
56
+ linewidth=2,
57
+ markersize=5,
58
+ )
59
+ plt.fill_between(iterations, gpt4_7b - 0.05, gpt4_7b + 0.05, color="#0a6ae1", alpha=0.2)
60
+ plt.fill_between(
61
+ iterations, gpt4_7b_ft - 0.03, gpt4_7b_ft + 0.03, color="#d75faa", alpha=0.2
62
+ )
63
+ plt.title(title_1, fontsize=14)
64
+ plt.xlabel(xlabel_value, fontsize=12)
65
+ plt.ylabel(ylabel_value, fontsize=12)
66
+
67
+ # Second subplot
68
+ plt.subplot(1, 2, 2)
69
+ plt.plot(
70
+ iterations,
71
+ llama_7b,
72
+ marker="o",
73
+ color="#0a6ae1",
74
+ label=label_1,
75
+ markerfacecolor="#0a6ae1",
76
+ linewidth=2,
77
+ markersize=5,
78
+ )
79
+ plt.plot(
80
+ iterations,
81
+ llama_7b_ft,
82
+ marker="o",
83
+ color="#d75faa",
84
+ label=label_2,
85
+ markerfacecolor="#d75faa",
86
+ linewidth=2,
87
+ markersize=5,
88
+ )
89
+ plt.fill_between(
90
+ iterations, llama_7b - 0.05, llama_7b + 0.05, color="#0a6ae1", alpha=0.2
91
+ )
92
+ plt.fill_between(
93
+ iterations, llama_7b_ft - 0.03, llama_7b_ft + 0.03, color="#d75faa", alpha=0.2
94
+ )
95
+ plt.title(title_2, fontsize=14)
96
+ plt.xlabel(xlabel_value, fontsize=12)
97
+ plt.ylabel(ylabel_value, fontsize=12)
98
+ plt.legend(loc="lower right", frameon=True, bbox_to_anchor=(1, 0.1))
99
+
100
+ # ===================
101
+ # Part 4: Saving Output
102
+ # ===================
103
+ # Adjust layout and save plot
104
+ plt.tight_layout()
105
+ plt.savefig('line_18.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_19.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np; np.random.seed(0)
6
+
7
+
8
+ # ===================
9
+ # Part 2: Data Preparation
10
+ # ===================
11
+ # Data for plotting
12
+ fraction_of_training_data = np.array([0.01, 0.1, 1])
13
+ full_accuracy = np.array([60, 70, 80])
14
+ spt_accuracy = np.array([55, 65, 78])
15
+ vpt_accuracy = np.array([42, 53, 65])
16
+
17
+ # Axes Limits and Labels
18
+ xlabel_value = "fraction of training data (log scale)"
19
+ xlim_values = [5, 25]
20
+
21
+ ylabel_value = "test accuracy (%)"
22
+ ylim_values = [38, 84]
23
+ yticks_values = np.arange(40, 82, 10)
24
+
25
+ # Labels
26
+ label_Full = "Full"
27
+ label_SPT = "SPT"
28
+ label_VPT = "VPT"
29
+
30
+ # ===================
31
+ # Part 3: Plot Configuration and Rendering
32
+ # ===================
33
+ # Plotting the data
34
+ plt.figure(figsize=(5, 4)) # Adjusting figure size to match original image dimensions
35
+ plt.plot(fraction_of_training_data, full_accuracy, "o-", color="green", label=label_Full)
36
+ plt.plot(fraction_of_training_data, spt_accuracy, "o-", color="red", label=label_SPT)
37
+ plt.plot(fraction_of_training_data, vpt_accuracy, "o-", color="blue", label=label_VPT)
38
+
39
+ # Set y-axis to only display specific ticks and extend y-axis to leave space at top
40
+ plt.yticks(yticks_values, fontsize=16)
41
+ plt.ylim(ylim_values) # Adjusted y-axis limit
42
+
43
+ # Set x-axis fontsize
44
+ plt.xticks(fontsize=16)
45
+
46
+ # Setting the x-axis to log scale
47
+ plt.xscale("log")
48
+
49
+ # Adding labels and title
50
+ plt.xlabel(xlabel_value, fontsize=16)
51
+ plt.ylabel(ylabel_value, fontsize=16)
52
+
53
+ # Adding grid
54
+ plt.grid(True, which="both", ls="-", linewidth=0.8)
55
+
56
+ # Adding legend, show it horizontally and place it at the lower right corner
57
+ plt.legend(loc="lower right", fontsize=12, ncol=3, columnspacing=0.5, edgecolor="black")
58
+
59
+ # ===================
60
+ # Part 4: Saving Output
61
+ # ===================
62
+ # Adjusting layout to add more space on the right
63
+ plt.tight_layout()
64
+ plt.savefig('line_19.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_26.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+
5
+ import matplotlib.pyplot as plt
6
+ import numpy as np; np.random.seed(0)
7
+
8
+ from matplotlib.ticker import MultipleLocator
9
+
10
+ # ===================
11
+ # Part 2: Data Preparation
12
+ # ===================
13
+ # Data for plotting
14
+ vocab_sizes = ["256", "512", "1024", "2048", "4096", "8192", "16384"]
15
+ bpe_values = [0.4, 0.8, 0.9, 0.95, 0.95, 0.95, 0.95]
16
+ wordpunct_values = [0.3, 0.6, 0.8, 0.85, 0.9, 0.9, 0.9]
17
+ whitespace_values = [0.5, 0.65, 0.7, 0.75, 0.7, 0.65, 0.6]
18
+
19
+ # Variables for plot configuration
20
+ line_labels = ["BPE", "Wordpunct", "Whitespace"]
21
+ xlim_values = (0, len(vocab_sizes) - 1)
22
+ ylim_values = (0.2, 1.0)
23
+ xlabel_value = "Vocabulary Size"
24
+ ylabel_value = None
25
+ xticks_values = range(len(vocab_sizes))
26
+ yticks_values = np.arange(0.2, 1.1, 0.2)
27
+ xtickslabel_values = vocab_sizes
28
+ ytickslabel_values = None
29
+ title_value = "Test set TPR | FPR = $10^{-4}$"
30
+ axhline_value = None
31
+ axvline_value = None
32
+
33
+ # ===================
34
+ # Part 3: Plot Configuration and Rendering
35
+ # ===================
36
+ # Plotting the lines
37
+ plt.figure(figsize=(8, 6))
38
+ plt.plot(
39
+ vocab_sizes,
40
+ bpe_values,
41
+ "o--",
42
+ clip_on=False,
43
+ zorder=10,
44
+ color="#0c5da5",
45
+ label=line_labels[0],
46
+ )
47
+ plt.plot(
48
+ vocab_sizes,
49
+ wordpunct_values,
50
+ "o--",
51
+ clip_on=False,
52
+ zorder=10,
53
+ color="#ff9500",
54
+ label=line_labels[1],
55
+ )
56
+ plt.plot(
57
+ vocab_sizes,
58
+ whitespace_values,
59
+ "o--",
60
+ clip_on=False,
61
+ zorder=10,
62
+ color="#00b945",
63
+ label=line_labels[2],
64
+ )
65
+
66
+ # Setting x and y ticks
67
+ plt.xticks(xticks_values, xtickslabel_values, fontsize=14)
68
+ plt.xlim(xlim_values)
69
+ plt.yticks(yticks_values, fontsize=14)
70
+
71
+ # Adding minor y-axis ticks with a step of 0.05
72
+ ax = plt.gca()
73
+ # ax.yaxis.set_minor_locator(MultipleLocator(0.05))
74
+
75
+ # Adjust tick parameters
76
+ ax.tick_params(axis="both", which="both", length=5, color="gray") # Move ticks inside
77
+ ax.tick_params(
78
+ axis="y", which="minor", length=2
79
+ ) # Ensure minor ticks are visible but smaller
80
+
81
+ # Title and labels
82
+ plt.title(title_value, fontsize=14)
83
+ plt.xlabel(xlabel_value, fontsize=14)
84
+
85
+ # Enable gridlines for minor ticks
86
+ plt.grid(True, color="#b0b0b0", which="major", linestyle="-", linewidth=0.5)
87
+
88
+ # Legend with serif font family
89
+ plt.legend(
90
+ frameon=False, fontsize=12, loc="lower center", bbox_to_anchor=(0.5, -0.2), ncol=3
91
+ )
92
+
93
+ # ===================
94
+ # Part 4: Saving Output
95
+ # ===================
96
+ # Adjusting layout to add more space on the right
97
+ plt.tight_layout()
98
+
99
+ plt.savefig('line_26.pdf', bbox_inches='tight')
100
+
ChartMimic/dataset/ori_500/line_28.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np; np.random.seed(0)
6
+
7
+
8
+ # ===================
9
+ # Part 2: Data Preparation
10
+ # ===================
11
+ # Data
12
+ x = [0, 25, 50, 75, 100, 125, 150, 175, 200]
13
+ pilote_y = [0.85, 0.88, 0.90, 0.92, 0.93, 0.94, 0.80, 0.75, 0.70]
14
+ retrained_y = [0.78, 0.80, 0.83, 0.85, 0.87, 0.88, 0.89, 0.90, 0.91]
15
+ pretrained_accuracy = 0.75
16
+
17
+ # Axes Limits and Labels
18
+ xlabel_value = "Number of exemplars in class 'Run'"
19
+ xlim_values = [-10, 215]
20
+ xticks_values = np.arange(25, 201, 25)
21
+
22
+ ylabel_value = "avg. accuracy of five rounds"
23
+ ylim_values = [0, 100]
24
+ yticks_values = np.arange(0.60, 1.00, 0.05)
25
+
26
+ # Labels
27
+ label_1 = "PILOTE"
28
+ label_2 = "Re-trained model"
29
+ label_3 = "Pre-trained model accuracy"
30
+
31
+ # ===================
32
+ # Part 3: Plot Configuration and Rendering
33
+ # ===================
34
+ # Plot
35
+ fig, ax = plt.subplots(
36
+ figsize=(6, 4)
37
+ ) # Adjusting figure size to match original image dimensions
38
+
39
+ # Line charts
40
+ ax.plot(x, pilote_y, marker="s", color="#d62728", label=label_1)
41
+ ax.plot(
42
+ x, retrained_y, marker="p", color="#1f77b4", label=label_2, markersize=8
43
+ )
44
+
45
+ # Set x,y-axis to only display specific ticks and extend y-axis to leave space at top
46
+ plt.yticks(yticks_values, fontsize=12)
47
+ plt.xticks(xticks_values, fontsize=12)
48
+ plt.xlim(xlim_values) # Adjusted y-axis limit
49
+
50
+ # Horizontal dashed line
51
+ ax.axhline(
52
+ y=pretrained_accuracy,
53
+ color="green",
54
+ linestyle="-.",
55
+ label=label_3,
56
+ )
57
+
58
+ # Legend
59
+ ax.legend(loc="lower right")
60
+
61
+ # Labels
62
+ ax.set_xlabel(xlabel_value)
63
+ ax.set_ylabel(ylabel_value)
64
+
65
+ # ===================
66
+ # Part 4: Saving Output
67
+ # ===================
68
+ # Adjust layout and show plot
69
+ plt.tight_layout()
70
+ plt.savefig('line_28.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_29.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+
6
+ # ===================
7
+ # Part 2: Data Preparation
8
+ # ===================
9
+ # Data for plotting
10
+ xllm_steps = range(1, 21)
11
+ xLLM_fidelity = [
12
+ 0.1,
13
+ 0.125,
14
+ 0.15,
15
+ 0.1625,
16
+ 0.175,
17
+ 0.1875,
18
+ 0.2,
19
+ 0.2125,
20
+ 0.225,
21
+ 0.2375,
22
+ 0.25,
23
+ 0.25625,
24
+ 0.2625,
25
+ 0.26875,
26
+ 0.275,
27
+ 0.275,
28
+ 0.275,
29
+ 0.275,
30
+ 0.275,
31
+ 0.275,
32
+ ]
33
+ single_steps = [0, 21]
34
+ single_pass_fidelity = [0.1] * len(single_steps)
35
+
36
+ # Axes Limits and Labels
37
+ xlabel_value = "# of Steps"
38
+ xlim_values = [0, 21]
39
+ xticks_values = [0, 5, 10, 15, 20]
40
+
41
+ ylabel_value = "Avg. Fidelity"
42
+ ylim_values = [0, 100]
43
+
44
+ # Labels
45
+ label_1 = "xLLM"
46
+ label_2 = "Single-Pass LLM"
47
+
48
+ # ===================
49
+ # Part 3: Plot Configuration and Rendering
50
+ # ===================
51
+ # Plotting the lines
52
+ plt.figure(figsize=(4, 3))
53
+ plt.plot(xllm_steps, xLLM_fidelity, "o-.", label=label_1, color="#8280cd")
54
+ plt.plot(single_steps, single_pass_fidelity, "-", label=label_2, color="red")
55
+
56
+ # Adding legend
57
+ plt.legend()
58
+
59
+ # Labeling axes
60
+ plt.xlabel(xlabel_value)
61
+ plt.ylabel(ylabel_value)
62
+ plt.xlim(xlim_values)
63
+ plt.xticks(xticks_values)
64
+
65
+ # ===================
66
+ # Part 4: Saving Output
67
+ # ===================
68
+ # Display the plot with tight layout to minimize white space
69
+ plt.tight_layout()
70
+ plt.savefig('line_29.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_38.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===================
2
+ # Part 1: Importing Libraries
3
+ # ===================
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np; np.random.seed(0)
6
+
7
+
8
+ # ===================
9
+ # Part 2: Data Preparation
10
+ # ===================
11
+ # Data
12
+ epochs = ["3", "10", "30", "100"] # Treat epochs as strings to make them categorical
13
+ gpt_neo = [0.8, 0.8, 0.8, 0.8]
14
+ model_3 = [0.7, 0.65, 0.6, 0.75]
15
+ model_5 = [0.65, 0.75, 0.35, 0.5]
16
+ model_7 = [0.6, 0.65, 0.5, 0.65]
17
+ model_10 = [0.45, 0.5, 0.45, 0.4]
18
+ model_30 = [0.3, 0.45, 0.75, 0.35]
19
+
20
+ # Axes Limits and Labels
21
+ xlabel_value = "# Epochs"
22
+
23
+ ylabel_value = "MA"
24
+ ylim_values = [0.0, 0.83]
25
+ yticks_values = np.arange(0.0, 0.81, 0.2)
26
+
27
+ # Labels
28
+ label_GPT_Neo="GPT-Neo"
29
+ label_3 = "3"
30
+ label_5 = "5"
31
+ label_7 = "7"
32
+ label_10 = "10"
33
+ label_30 = "30"
34
+
35
+ # ===================
36
+ # Part 3: Plot Configuration and Rendering
37
+ # ===================
38
+ # Plot
39
+ plt.figure(figsize=(6, 3))
40
+ plt.axhline(y=0.8, color="black", linestyle="--", linewidth=1, label=label_GPT_Neo)
41
+ plt.plot(epochs, model_3, "r-", marker="s", label=label_3)
42
+ plt.plot(epochs, model_5, "y-", marker="s", label=label_5)
43
+ plt.plot(epochs, model_7, "k-", marker="s", label=label_7)
44
+ plt.plot(epochs, model_10, "b-", marker="s", label=label_10)
45
+ plt.plot(epochs, model_30, "g-", marker="s", label=label_30)
46
+
47
+ plt.yticks(yticks_values, fontsize=14)
48
+ plt.ylim(ylim_values)
49
+
50
+ # Set x-axis labels equidistantly
51
+ ax = plt.gca()
52
+ ax.set_xticks(np.arange(len(epochs))) # Positional indexing for equidistant spacing
53
+ ax.set_xticklabels(epochs, fontsize=14) # Labeling x-ticks as per epochs
54
+
55
+ plt.xlabel(xlabel_value, fontsize=16)
56
+ plt.ylabel(ylabel_value, fontsize=16)
57
+
58
+ plt.legend(
59
+ loc="lower left", ncol=3, fontsize=12, columnspacing=5
60
+ ) # Adjusted legend settings
61
+
62
+ # ===================
63
+ # Part 4: Saving Output
64
+ # ===================
65
+ # Adjust layout and show plot
66
+ plt.tight_layout()
67
+ plt.savefig('line_38.pdf', bbox_inches='tight')
ChartMimic/dataset/ori_500/line_40.png ADDED
ChartMimic/dataset/ori_500/line_41.png ADDED
ChartMimic/dataset/ori_500/line_42.png ADDED