Spaces:
Sleeping
Sleeping
Upload 94 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- ChartMimic/dataset/ori_500/line_31.png +0 -0
- ChartMimic/dataset/ori_500/line_31.py +102 -0
- ChartMimic/dataset/ori_500/line_32.png +0 -0
- ChartMimic/dataset/ori_500/line_32.py +101 -0
- ChartMimic/dataset/ori_500/line_33.png +0 -0
- ChartMimic/dataset/ori_500/line_33.py +64 -0
- ChartMimic/dataset/ori_500/line_34.png +0 -0
- ChartMimic/dataset/ori_500/line_34.py +141 -0
- ChartMimic/dataset/ori_500/line_35.png +0 -0
- ChartMimic/dataset/ori_500/line_35.py +88 -0
- ChartMimic/dataset/ori_500/line_36.png +0 -0
- ChartMimic/dataset/ori_500/line_36.py +96 -0
- ChartMimic/dataset/ori_500/line_37.png +0 -0
- ChartMimic/dataset/ori_500/line_37.py +112 -0
- ChartMimic/dataset/ori_500/line_38.png +0 -0
- ChartMimic/dataset/ori_500/line_38.py +67 -0
- ChartMimic/dataset/ori_500/line_40.png +0 -0
- ChartMimic/dataset/ori_500/line_40.py +71 -0
- ChartMimic/dataset/ori_500/line_41.png +0 -0
- ChartMimic/dataset/ori_500/line_41.py +130 -0
- ChartMimic/dataset/ori_500/line_42.png +0 -0
- ChartMimic/dataset/ori_500/line_42.py +74 -0
- ChartMimic/dataset/ori_500/line_43.png +0 -0
- ChartMimic/dataset/ori_500/line_43.py +109 -0
- ChartMimic/dataset/ori_500/line_44.png +0 -0
- ChartMimic/dataset/ori_500/line_44.py +98 -0
- ChartMimic/dataset/ori_500/line_46.png +0 -0
- ChartMimic/dataset/ori_500/line_46.py +79 -0
- ChartMimic/dataset/ori_500/line_47.png +0 -0
- ChartMimic/dataset/ori_500/line_47.py +94 -0
- ChartMimic/dataset/ori_500/line_48.png +0 -0
- ChartMimic/dataset/ori_500/line_48.py +74 -0
- ChartMimic/dataset/ori_500/line_49.png +0 -0
- ChartMimic/dataset/ori_500/line_49.py +133 -0
- ChartMimic/dataset/ori_500/line_50.png +0 -0
- ChartMimic/dataset/ori_500/line_50.py +89 -0
- ChartMimic/dataset/ori_500/line_51.png +0 -0
- ChartMimic/dataset/ori_500/line_51.py +79 -0
- ChartMimic/dataset/ori_500/line_52.png +0 -0
- ChartMimic/dataset/ori_500/line_52.py +63 -0
- ChartMimic/dataset/ori_500/line_53.png +0 -0
- ChartMimic/dataset/ori_500/line_53.py +77 -0
- ChartMimic/dataset/ori_500/line_54.png +0 -0
- ChartMimic/dataset/ori_500/line_54.py +83 -0
- ChartMimic/dataset/ori_500/line_55.png +0 -0
- ChartMimic/dataset/ori_500/line_55.py +86 -0
- ChartMimic/dataset/ori_500/line_56.png +0 -0
- ChartMimic/dataset/ori_500/line_56.py +117 -0
- ChartMimic/dataset/ori_500/line_57.png +0 -0
- ChartMimic/dataset/ori_500/line_57.py +141 -0
ChartMimic/dataset/ori_500/line_31.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_31.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Placeholder data
|
12 |
+
digit_length = np.arange(6, 10)
|
13 |
+
direct_accuracy = [1.05, 0.95, 0.7, 0.75]
|
14 |
+
rfft_accuracy = [1.0, 0.9, 0.88, 0.6]
|
15 |
+
scratchpad_100_accuracy = [0.72, 0.52, 0.45, 0.38]
|
16 |
+
scratchpad_5000_accuracy = [0.65, 0.75, 0.8, 0.95]
|
17 |
+
|
18 |
+
# Placeholder error values
|
19 |
+
direct_error = np.random.uniform(0.01, 0.05, len(digit_length))
|
20 |
+
rfft_error = np.random.uniform(0.01, 0.05, len(digit_length))
|
21 |
+
scratchpad_100_error = np.random.uniform(0.01, 0.05, len(digit_length))
|
22 |
+
scratchpad_5000_error = np.random.uniform(0.01, 0.05, len(digit_length))
|
23 |
+
|
24 |
+
# Axes Limits and Labels
|
25 |
+
xlabel_value = "Digit Length"
|
26 |
+
|
27 |
+
ylabel_value = "Accuracy"
|
28 |
+
ylim_values = [0.5, 1.1]
|
29 |
+
yticks_values = np.arange(0.3, 1.1, 0.1)
|
30 |
+
|
31 |
+
# Labels
|
32 |
+
label_1 = "Direct (100 samples)"
|
33 |
+
label_2 = "RFFT (100 samples)"
|
34 |
+
label_3 = "Scratchpad (100 samples)"
|
35 |
+
label_4 = "Scratchpad (5000 samples)"
|
36 |
+
|
37 |
+
# ===================
|
38 |
+
# Part 3: Plot Configuration and Rendering
|
39 |
+
# ===================
|
40 |
+
# Plotting the data
|
41 |
+
plt.figure(figsize=(8, 6)) # Adjusting figure size to match original image dimensions
|
42 |
+
plt.errorbar(
|
43 |
+
digit_length,
|
44 |
+
direct_accuracy,
|
45 |
+
yerr=direct_error,
|
46 |
+
fmt="-o",
|
47 |
+
label=label_1,
|
48 |
+
color="blue",
|
49 |
+
linestyle="dashed",
|
50 |
+
)
|
51 |
+
plt.errorbar(
|
52 |
+
digit_length,
|
53 |
+
rfft_accuracy,
|
54 |
+
yerr=rfft_error,
|
55 |
+
fmt="-s",
|
56 |
+
label=label_2,
|
57 |
+
color="green",
|
58 |
+
linestyle="dashed",
|
59 |
+
)
|
60 |
+
plt.errorbar(
|
61 |
+
digit_length,
|
62 |
+
scratchpad_100_accuracy,
|
63 |
+
yerr=scratchpad_100_error,
|
64 |
+
fmt="-^",
|
65 |
+
label=label_3,
|
66 |
+
color="orange",
|
67 |
+
linestyle="dashed",
|
68 |
+
)
|
69 |
+
plt.errorbar(
|
70 |
+
digit_length,
|
71 |
+
scratchpad_5000_accuracy,
|
72 |
+
yerr=scratchpad_5000_error,
|
73 |
+
fmt="-d",
|
74 |
+
label=label_4,
|
75 |
+
color="red",
|
76 |
+
linestyle="dashed",
|
77 |
+
)
|
78 |
+
|
79 |
+
# Adding labels and title
|
80 |
+
plt.xlabel(xlabel_value)
|
81 |
+
plt.ylabel(ylabel_value)
|
82 |
+
plt.xticks(digit_length)
|
83 |
+
plt.ylim(ylim_values)
|
84 |
+
plt.yticks(yticks_values)
|
85 |
+
|
86 |
+
# Adding legend, lower left corner
|
87 |
+
plt.legend(loc="lower left")
|
88 |
+
|
89 |
+
# Moving axes spines
|
90 |
+
ax = plt.gca() # get current axes
|
91 |
+
ax.spines["right"].set_color("none") # hide the right spine
|
92 |
+
ax.spines["top"].set_color("none") # hide the top spine
|
93 |
+
ax.grid(
|
94 |
+
True, which="both", axis="both", color="lightgray", linestyle="--", linewidth=0.5
|
95 |
+
)
|
96 |
+
|
97 |
+
# ===================
|
98 |
+
# Part 4: Saving Output
|
99 |
+
# ===================
|
100 |
+
# Display the plot with tight layout to minimize white space
|
101 |
+
plt.tight_layout()
|
102 |
+
plt.savefig('line_31.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_32.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_32.py
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
decomposition_IO_norm = [1, 12, 28, 93]
|
13 |
+
accuracy_laion = [0.225, 0.275, 0.325, 0.375]
|
14 |
+
accuracy_CLIP = [0.385, 0.385, 0.385, 0.385]
|
15 |
+
|
16 |
+
# Axes Limits and Labels
|
17 |
+
xlabel_value = "Decomposition IO Norm"
|
18 |
+
xlim_values = [-5, 95]
|
19 |
+
xticks_values = np.arange(0, 81, 20)
|
20 |
+
|
21 |
+
ylabel_value = "Accuracy"
|
22 |
+
ylim_values = [0.200, 0.400]
|
23 |
+
yticks_values = np.arange(0.200, 0.376, 0.025)
|
24 |
+
|
25 |
+
# Labels
|
26 |
+
label_laion="laion"
|
27 |
+
label_CLIP="CLIP"
|
28 |
+
label_deepjscc_w_ofdm = "DEEPJSCC w/ ofdm"
|
29 |
+
label_ours = "OURS"
|
30 |
+
|
31 |
+
# Titles
|
32 |
+
title_1 = "CIFAR100 States Zero Shot Accuracy"
|
33 |
+
title_2 = "Dictionary"
|
34 |
+
|
35 |
+
# ===================
|
36 |
+
# Part 3: Plot Configuration and Rendering
|
37 |
+
# ===================
|
38 |
+
# Create the figure and the line that we will manipulate
|
39 |
+
fig, ax = plt.subplots(figsize=(8, 6))
|
40 |
+
ax.plot(
|
41 |
+
decomposition_IO_norm,
|
42 |
+
accuracy_laion,
|
43 |
+
marker="o",
|
44 |
+
color="orange",
|
45 |
+
linewidth=2,
|
46 |
+
markersize=6,
|
47 |
+
markerfacecolor="orange",
|
48 |
+
label=label_laion,
|
49 |
+
)
|
50 |
+
|
51 |
+
# Extend the CLIP line visually by adding extra points
|
52 |
+
extended_x = [-5] + decomposition_IO_norm + [95] # Extend x-axis data points
|
53 |
+
extended_y = [0.385] * (len(accuracy_CLIP) + 2) # Extend y-axis data points to match
|
54 |
+
ax.plot(
|
55 |
+
extended_x, extended_y, linestyle="--", color="#202020", label=label_CLIP
|
56 |
+
) # Plot the extended line
|
57 |
+
|
58 |
+
# Set x,y-axis to only display specific ticks and extend y-axis to leave space at top
|
59 |
+
plt.yticks(yticks_values, fontsize=12)
|
60 |
+
plt.ylim(ylim_values) # Adjusted y-axis limit
|
61 |
+
plt.xticks(xticks_values, fontsize=12)
|
62 |
+
plt.xlim(xlim_values) # Adjusted x-axis limit
|
63 |
+
|
64 |
+
# Set the title and labels
|
65 |
+
ax.set_title(title_1, fontsize=20)
|
66 |
+
ax.set_xlabel(xlabel_value, fontsize=16)
|
67 |
+
ax.set_ylabel(ylabel_value, fontsize=16)
|
68 |
+
|
69 |
+
# Remove tick lines outside the plotting area
|
70 |
+
ax.tick_params(
|
71 |
+
axis="both", which="both", length=0, color="#d2d2d2"
|
72 |
+
) # Remove tick marks and set their color
|
73 |
+
|
74 |
+
# Add a legend with a title
|
75 |
+
ax.legend(
|
76 |
+
title=title_2,
|
77 |
+
loc="lower right",
|
78 |
+
fontsize=12,
|
79 |
+
title_fontsize=12,
|
80 |
+
edgecolor="#fdfdfd",
|
81 |
+
)
|
82 |
+
|
83 |
+
# Change the plot background color
|
84 |
+
ax.set_facecolor("#f5f5f5")
|
85 |
+
|
86 |
+
# Show grid with lighter color
|
87 |
+
ax.grid(True, color="#fcfcfc", linewidth=1.5)
|
88 |
+
|
89 |
+
# Change the axis colors
|
90 |
+
ax = plt.gca()
|
91 |
+
ax.spines["bottom"].set_color("#ffffff")
|
92 |
+
ax.spines["top"].set_color("#ffffff") # Optional: hide or set color
|
93 |
+
ax.spines["left"].set_color("#ffffff")
|
94 |
+
ax.spines["right"].set_color("#ffffff") # Optional: hide or set color
|
95 |
+
|
96 |
+
# ===================
|
97 |
+
# Part 4: Saving Output
|
98 |
+
# ===================
|
99 |
+
# Adjust layout and show plot
|
100 |
+
plt.tight_layout()
|
101 |
+
plt.savefig('line_32.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_33.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_33.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 |
+
# Sample data (replace with actual values)
|
12 |
+
users = [20, 40, 60, 80, 100]
|
13 |
+
cnn = [0.5, 0.65, 0.7, 0.72, 0.75]
|
14 |
+
cnn_hmm = [0.55, 0.6, 0.65, 0.68, 0.7]
|
15 |
+
rf = [0.45, 0.55, 0.6, 0.62, 0.65]
|
16 |
+
rf_hmm = [0.48, 0.58, 0.63, 0.65, 0.68]
|
17 |
+
|
18 |
+
# Axes Limits and Labels
|
19 |
+
xlabel_value = "No. of Users in Development Set"
|
20 |
+
xlim_values = [5, 105]
|
21 |
+
xticks_values = np.arange(20, 101, 20)
|
22 |
+
|
23 |
+
ylabel_value = "F1"
|
24 |
+
ylim_values = [0.44, 0.76]
|
25 |
+
yticks_values = np.arange(0.45, 0.76, 0.05)
|
26 |
+
|
27 |
+
# Labels
|
28 |
+
label_1 = "CNN"
|
29 |
+
label_2 = "CNN+HMM"
|
30 |
+
label_3 = "RF"
|
31 |
+
label_4 = "RF+HMM"
|
32 |
+
|
33 |
+
# ===================
|
34 |
+
# Part 3: Plot Configuration and Rendering
|
35 |
+
# ===================
|
36 |
+
# Create the plot
|
37 |
+
plt.figure(figsize=(6, 4)) # Adjusted to match the original image's dimensions
|
38 |
+
plt.plot(users, cnn, marker="v", color="#ffa500", label=label_1)
|
39 |
+
plt.plot(users, cnn_hmm, marker="^", color="#ff4500", label=label_2)
|
40 |
+
plt.plot(users, rf, marker="s", color="#4169e1", label=label_3)
|
41 |
+
plt.plot(users, rf_hmm, marker="o", color="#00008b", label=label_4)
|
42 |
+
|
43 |
+
# Set x,y-axis to only display specific ticks and extend y-axis to leave space at top
|
44 |
+
plt.xticks(xticks_values, fontsize=10)
|
45 |
+
plt.xlim(xlim_values) # Adjusted y-axis limit
|
46 |
+
plt.yticks(yticks_values, fontsize=10)
|
47 |
+
plt.ylim(ylim_values) # Adjusted x-axis limit
|
48 |
+
|
49 |
+
# Add vertical dotted line
|
50 |
+
plt.axvline(x=20, color="blue", linestyle=":", linewidth=1.2)
|
51 |
+
|
52 |
+
# Add legend
|
53 |
+
plt.legend(loc="lower right", fontsize=12)
|
54 |
+
|
55 |
+
# Add labels and title
|
56 |
+
plt.xlabel(xlabel_value, fontsize=12)
|
57 |
+
plt.ylabel(ylabel_value , fontsize=12)
|
58 |
+
|
59 |
+
# ===================
|
60 |
+
# Part 4: Saving Output
|
61 |
+
# ===================
|
62 |
+
# Adjust layout and save plot
|
63 |
+
plt.tight_layout()
|
64 |
+
plt.savefig('line_33.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_34.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_34.py
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ===================
|
2 |
+
# Part 1: Importing Libraries
|
3 |
+
# ===================
|
4 |
+
import matplotlib.pyplot as plt
|
5 |
+
from matplotlib.lines import Line2D # Importing Line2D for creating custom legend items
|
6 |
+
|
7 |
+
# ===================
|
8 |
+
# Part 2: Data Preparation
|
9 |
+
# ===================
|
10 |
+
# Data
|
11 |
+
microphones = [2, 3, 4, 5, 6, 7, 8]
|
12 |
+
libricss_wer = [
|
13 |
+
6.74,
|
14 |
+
4.54,
|
15 |
+
3.96,
|
16 |
+
3.71,
|
17 |
+
3.49,
|
18 |
+
3.34,
|
19 |
+
None,
|
20 |
+
] # The None value will be handled in the plot commands
|
21 |
+
ami_wer = [27.44, 24.75, 23.38, 22.77, 22.32, 21.47, 21.51]
|
22 |
+
ihm_wer = [3] * len(microphones)
|
23 |
+
sdm_wer = [10] * len(microphones)
|
24 |
+
|
25 |
+
# Axes Limits and Labels
|
26 |
+
xlabel_value = "Number of microphones"
|
27 |
+
|
28 |
+
ylabel_value_1 = "WER(%)"
|
29 |
+
ylabel_value_2 = "AMI WER(%)"
|
30 |
+
ylim_values_1 = [1, 11]
|
31 |
+
ylim_values_2 = [15, 32]
|
32 |
+
yticks_values_1 = range(2, 11, 2)
|
33 |
+
yticks_values_2 = range(15, 31, 5)
|
34 |
+
|
35 |
+
# Labels
|
36 |
+
label_1 = "LibriCSS (test)"
|
37 |
+
label_2 = "ImageNet-C/P (Fog)"
|
38 |
+
label_3 = "AMI (dev)"
|
39 |
+
|
40 |
+
# ===================
|
41 |
+
# Part 3: Plot Configuration and Rendering
|
42 |
+
# ===================
|
43 |
+
# Plot
|
44 |
+
fig, ax1 = plt.subplots(figsize=(8, 7))
|
45 |
+
|
46 |
+
# LibriCSS plot
|
47 |
+
(libricss_line,) = ax1.plot(
|
48 |
+
microphones,
|
49 |
+
libricss_wer,
|
50 |
+
"o-",
|
51 |
+
color="#377eb8",
|
52 |
+
label=label_1,
|
53 |
+
markersize=10,
|
54 |
+
linewidth=3,
|
55 |
+
mec="black",
|
56 |
+
)
|
57 |
+
ax1.set_xlabel(xlabel_value, fontsize=14)
|
58 |
+
ax1.set_ylabel(ylabel_value_1, fontsize=14, color="#377eb8")
|
59 |
+
ax1.tick_params(
|
60 |
+
axis="y", labelcolor="#377eb8", direction="in", rotation=90, labelsize=12
|
61 |
+
)
|
62 |
+
ax1.tick_params(
|
63 |
+
axis="x",
|
64 |
+
direction="in",
|
65 |
+
labelsize=12,
|
66 |
+
)
|
67 |
+
ax1.set_yticks(yticks_values_1)
|
68 |
+
ax1.set_ylim(ylim_values_1)
|
69 |
+
|
70 |
+
# Adding WER values to the plot for libricss
|
71 |
+
for i, txt in enumerate(libricss_wer):
|
72 |
+
if txt is not None: # Skip plotting the text for None values
|
73 |
+
ax1.annotate(
|
74 |
+
f"{txt}%",
|
75 |
+
(microphones[i], txt),
|
76 |
+
textcoords="offset points",
|
77 |
+
xytext=(10, 10),
|
78 |
+
ha="center",
|
79 |
+
fontsize=12,
|
80 |
+
)
|
81 |
+
|
82 |
+
# AMI plot with a secondary y-axis
|
83 |
+
ax2 = ax1.twinx()
|
84 |
+
(ami_line,) = ax2.plot(
|
85 |
+
microphones,
|
86 |
+
ami_wer,
|
87 |
+
"^-",
|
88 |
+
color="#ff7f00",
|
89 |
+
label=label_3,
|
90 |
+
markersize=10,
|
91 |
+
linewidth=3,
|
92 |
+
mec="black",
|
93 |
+
)
|
94 |
+
ax2.set_ylabel(ylabel_value_2, color="#ff7f00", fontsize=14)
|
95 |
+
ax2.tick_params(
|
96 |
+
axis="y", labelcolor="#ff7f00", direction="in", rotation=90, labelsize=12
|
97 |
+
)
|
98 |
+
ax2.set_yticks(yticks_values_2)
|
99 |
+
ax2.set_ylim(ylim_values_2)
|
100 |
+
|
101 |
+
# Adding WER values to the plot for ami
|
102 |
+
for i, txt in enumerate(ami_wer):
|
103 |
+
ax2.annotate(
|
104 |
+
f"{txt}%",
|
105 |
+
(microphones[i], txt),
|
106 |
+
textcoords="offset points",
|
107 |
+
xytext=(0, -30),
|
108 |
+
ha="center",
|
109 |
+
fontsize=12,
|
110 |
+
)
|
111 |
+
|
112 |
+
# IHM dashed lines
|
113 |
+
ax1.axhline(y=2.2, color="#377eb8", linestyle=":", linewidth=2)
|
114 |
+
ax1.axhline(y=2.4, color="#ff7f00", linestyle=":", linewidth=2)
|
115 |
+
|
116 |
+
# SDM dashed lines
|
117 |
+
ax1.axhline(y=9.6, color="#377eb8", linestyle="--", linewidth=2)
|
118 |
+
ax1.axhline(y=9.4, color="#ff7f00", linestyle="--", linewidth=2)
|
119 |
+
|
120 |
+
# Creating custom legend items
|
121 |
+
ihm_legend = Line2D([0], [0], color="black", linestyle=":", linewidth=2, label="IHM")
|
122 |
+
sdm_legend = Line2D([0], [0], color="black", linestyle="--", linewidth=2, label="SDM")
|
123 |
+
|
124 |
+
# Adding legends
|
125 |
+
first_legend = ax1.legend(
|
126 |
+
handles=[ihm_legend, sdm_legend],
|
127 |
+
loc="upper left",
|
128 |
+
ncol=2,
|
129 |
+
fontsize=14,
|
130 |
+
edgecolor="black",
|
131 |
+
)
|
132 |
+
ax1.add_artist(first_legend) # Add the first legend manually
|
133 |
+
second_legend = ax1.legend(
|
134 |
+
handles=[libricss_line, ami_line], loc="upper right", fontsize=14, edgecolor="black"
|
135 |
+
) # Add the second legend
|
136 |
+
|
137 |
+
# ===================
|
138 |
+
# Part 4: Saving Output
|
139 |
+
# ===================
|
140 |
+
plt.tight_layout()
|
141 |
+
plt.savefig('line_34.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_35.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_35.py
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
quantization_error = np.array(
|
13 |
+
[10 ** (-7), 10 ** (-6.4), 10 ** (-5.7), 10 ** (-5.2), 10 ** (-4.5), 10 ** (-3.8)]
|
14 |
+
)
|
15 |
+
search_window_ratio = np.array([1, 1.05, 1.15, 1.2, 2, 6.6])
|
16 |
+
|
17 |
+
# Labels and Plot Types
|
18 |
+
x_M_LVQ_4x8_10 = 10 ** (-4.9)
|
19 |
+
label_M_LVQ_4x8_10 = "M-LVQ-4x8-10"
|
20 |
+
x_M_LVQ_4x8_100 = 10 ** (-4.8)
|
21 |
+
label_M_LVQ_4x8_100 = "M-LVQ-4x8-100"
|
22 |
+
x_M_LVQ_4x8_256 =10 ** (-4.6)
|
23 |
+
label_M_LVQ_4x8_256 = "M-LVQ-4x8-256"
|
24 |
+
x_M_LVQ_4x8 = 10 ** (-4.5)
|
25 |
+
label_M_LVQ_4x8 = "M-LVQ-4x8"
|
26 |
+
label_empirical_relat_B2_8_0 = "empirical relat. (B2=8.0)"
|
27 |
+
|
28 |
+
# Axes Limits and Labels
|
29 |
+
yticks_values = np.arange(0, 8, 1)
|
30 |
+
ylim_values = [0, 7]
|
31 |
+
xlabel_value = "Quantization error"
|
32 |
+
ylabel_value = "Search window size ratio"
|
33 |
+
|
34 |
+
# ===================
|
35 |
+
# Part 3: Plot Configuration and Rendering
|
36 |
+
# ===================
|
37 |
+
# Create figure and axis
|
38 |
+
fig, ax = plt.subplots(figsize=(6, 4))
|
39 |
+
|
40 |
+
# Add vertical lines
|
41 |
+
ax.axvline(
|
42 |
+
x=x_M_LVQ_4x8_10, color="#d86810", linestyle="--", label=label_M_LVQ_4x8_10, linewidth=3
|
43 |
+
)
|
44 |
+
ax.axvline(
|
45 |
+
x=x_M_LVQ_4x8_100, color="#029e73", linestyle="--", label=label_M_LVQ_4x8_100, linewidth=3
|
46 |
+
)
|
47 |
+
ax.axvline(
|
48 |
+
x=x_M_LVQ_4x8_256, color="#de8f05", linestyle="--", label=label_M_LVQ_4x8_256, linewidth=3
|
49 |
+
)
|
50 |
+
ax.axvline(
|
51 |
+
x=x_M_LVQ_4x8, color="#cc78bc", linestyle="--", label=label_M_LVQ_4x8, linewidth=3
|
52 |
+
)
|
53 |
+
|
54 |
+
# Plot the empirical relationship line
|
55 |
+
ax.plot(
|
56 |
+
quantization_error,
|
57 |
+
search_window_ratio,
|
58 |
+
label=label_empirical_relat_B2_8_0,
|
59 |
+
color="#0173b2",
|
60 |
+
marker="o",
|
61 |
+
markersize=8,
|
62 |
+
mec="white",
|
63 |
+
linewidth=3,
|
64 |
+
)
|
65 |
+
|
66 |
+
# Set yticks
|
67 |
+
plt.yticks(yticks_values, fontsize=10)
|
68 |
+
plt.ylim(ylim_values) # Adjusted y-axis limit
|
69 |
+
|
70 |
+
# Customize the plot
|
71 |
+
ax.set_xscale("log")
|
72 |
+
ax.set_xlabel(xlabel_value, fontsize=16)
|
73 |
+
ax.set_ylabel(ylabel_value, fontsize=16)
|
74 |
+
|
75 |
+
# Remove x-axis minor ticks
|
76 |
+
ax.tick_params(axis="x", which="minor", bottom=False)
|
77 |
+
|
78 |
+
# Add grid for major ticks only
|
79 |
+
ax.grid(True, which="major", linestyle="-", linewidth=0.5)
|
80 |
+
|
81 |
+
# Add legend
|
82 |
+
ax.legend(loc="upper left", bbox_to_anchor=(0, 1), fontsize=13)
|
83 |
+
|
84 |
+
# ===================
|
85 |
+
# Part 4: Saving Output
|
86 |
+
# ===================
|
87 |
+
plt.tight_layout() # Adjust layout to not cut off legend
|
88 |
+
plt.savefig('line_35.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_36.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_36.py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
ratios = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])
|
13 |
+
pna_performance = np.array([0.6, 0.65, 0.7, 0.75, 0.8, 0.82, 0.85, 0.83, 0.82, 0.8])
|
14 |
+
gin_performance = np.array([0.5, 0.52, 0.55, 0.57, 0.6, 0.62, 0.63, 0.65, 0.64, 0.63])
|
15 |
+
pna_std = np.array([0.05] * 10)
|
16 |
+
gin_std = np.array([0.08] * 10)
|
17 |
+
|
18 |
+
# Axes Limits and Labels
|
19 |
+
xlabel_value = "Ratio r"
|
20 |
+
xlim_values = [0.05, 1.05]
|
21 |
+
xticks_values = np.arange(0.1, 1.05, 0.1)
|
22 |
+
|
23 |
+
ylabel_value = "Performance"
|
24 |
+
yticks_values_1 = np.arange(0.5, 0.82, 0.1)
|
25 |
+
ylim_values_1 = [0.42, 0.9]
|
26 |
+
yticks_values_2 = np.arange(0.4, 0.82, 0.1)
|
27 |
+
ylim_values_2 = 0.35, 0.9
|
28 |
+
yticks_values_3 = np.arange(0.4, 0.82, 0.1)
|
29 |
+
ylim_values_3 = [0.35, 0.9]
|
30 |
+
|
31 |
+
# Labels
|
32 |
+
labels = ["PNA + ours", "GIN + ours"]
|
33 |
+
|
34 |
+
# Titles
|
35 |
+
titles = ["SPMotif-0.5", "SPMotif-0.7", "SPMotif-0.9"]
|
36 |
+
|
37 |
+
# ===================
|
38 |
+
# Part 3: Plot Configuration and Rendering
|
39 |
+
# ===================
|
40 |
+
# Plot settings
|
41 |
+
fig, axs = plt.subplots(1, 3, figsize=(15, 5))
|
42 |
+
colors = ["#9467bd", "#ff7f0e"]
|
43 |
+
markers = ["s", "s"] # Square and circle markers
|
44 |
+
|
45 |
+
for i, ax in enumerate(axs):
|
46 |
+
ax.plot(
|
47 |
+
ratios, pna_performance, label=labels[0], color=colors[0], marker=markers[0]
|
48 |
+
)
|
49 |
+
ax.fill_between(
|
50 |
+
ratios,
|
51 |
+
pna_performance - pna_std,
|
52 |
+
pna_performance + pna_std,
|
53 |
+
color=colors[0],
|
54 |
+
alpha=0.2,
|
55 |
+
)
|
56 |
+
ax.plot(
|
57 |
+
ratios, gin_performance, label=labels[1], color=colors[1], marker=markers[1]
|
58 |
+
)
|
59 |
+
ax.fill_between(
|
60 |
+
ratios,
|
61 |
+
gin_performance - gin_std,
|
62 |
+
gin_performance + gin_std,
|
63 |
+
color=colors[1],
|
64 |
+
alpha=0.2,
|
65 |
+
)
|
66 |
+
ax.set_xticks(xticks_values)
|
67 |
+
ax.set_xlim(xlim_values)
|
68 |
+
ax.set_title(titles[i])
|
69 |
+
ax.set_xlabel(xlabel_value)
|
70 |
+
ax.grid(True)
|
71 |
+
|
72 |
+
# Adjust subplot layout
|
73 |
+
plt.subplots_adjust(wspace=0.3)
|
74 |
+
|
75 |
+
axs[0].set_yticks(yticks_values_1)
|
76 |
+
axs[0].set_ylim(ylim_values_1)
|
77 |
+
axs[1].set_yticks(yticks_values_2)
|
78 |
+
axs[1].set_ylim(ylim_values_2)
|
79 |
+
axs[2].set_yticks(yticks_values_3)
|
80 |
+
axs[2].set_ylim(ylim_values_3)
|
81 |
+
|
82 |
+
# Move legend inside the plot area
|
83 |
+
axs[0].legend(loc="upper left")
|
84 |
+
axs[1].legend(loc="lower right")
|
85 |
+
axs[2].legend(loc="lower left")
|
86 |
+
|
87 |
+
# Adjust y-axis label to match reference picture
|
88 |
+
axs[0].set_ylabel(ylabel_value)
|
89 |
+
axs[1].set_ylabel(ylabel_value)
|
90 |
+
axs[2].set_ylabel(ylabel_value)
|
91 |
+
|
92 |
+
# ===================
|
93 |
+
# Part 4: Saving Output
|
94 |
+
# ===================
|
95 |
+
plt.tight_layout()
|
96 |
+
plt.savefig('line_36.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_37.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_37.py
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
ensemble_size = np.arange(5, 31, 1)
|
13 |
+
accuracy_mean = np.array(
|
14 |
+
[
|
15 |
+
75.2,
|
16 |
+
76.1,
|
17 |
+
76.7,
|
18 |
+
77.0,
|
19 |
+
77.2,
|
20 |
+
77.3,
|
21 |
+
77.4,
|
22 |
+
77.5,
|
23 |
+
77.5,
|
24 |
+
77.5,
|
25 |
+
77.5,
|
26 |
+
77.5,
|
27 |
+
77.5,
|
28 |
+
77.5,
|
29 |
+
77.5,
|
30 |
+
77.5,
|
31 |
+
77.5,
|
32 |
+
77.5,
|
33 |
+
77.5,
|
34 |
+
77.5,
|
35 |
+
77.5,
|
36 |
+
77.5,
|
37 |
+
77.5,
|
38 |
+
77.5,
|
39 |
+
77.5,
|
40 |
+
77.5,
|
41 |
+
]
|
42 |
+
)
|
43 |
+
accuracy_std = np.array(
|
44 |
+
[
|
45 |
+
1.0,
|
46 |
+
0.9,
|
47 |
+
0.8,
|
48 |
+
0.7,
|
49 |
+
0.6,
|
50 |
+
0.5,
|
51 |
+
0.4,
|
52 |
+
0.3,
|
53 |
+
0.3,
|
54 |
+
0.3,
|
55 |
+
0.3,
|
56 |
+
0.3,
|
57 |
+
0.3,
|
58 |
+
0.3,
|
59 |
+
0.3,
|
60 |
+
0.3,
|
61 |
+
0.3,
|
62 |
+
0.3,
|
63 |
+
0.3,
|
64 |
+
0.3,
|
65 |
+
0.3,
|
66 |
+
0.3,
|
67 |
+
0.3,
|
68 |
+
0.3,
|
69 |
+
0.3,
|
70 |
+
0.3,
|
71 |
+
]
|
72 |
+
)
|
73 |
+
|
74 |
+
# Axes Limits and Labels
|
75 |
+
xlabel_value = "Ensemble Size"
|
76 |
+
xlim_values = [3.5, 32]
|
77 |
+
xticks_values = np.arange(6, 31, 3)
|
78 |
+
|
79 |
+
ylabel_value = "Accuracy"
|
80 |
+
ylim_values = [74.5, 78.0]
|
81 |
+
|
82 |
+
|
83 |
+
# ===================
|
84 |
+
# Part 3: Plot Configuration and Rendering
|
85 |
+
# ===================
|
86 |
+
# Plotting the mean accuracy with the standard deviation as a shaded area
|
87 |
+
plt.figure(figsize=(6, 5))
|
88 |
+
plt.plot(ensemble_size, accuracy_mean, color="#1f77b4")
|
89 |
+
plt.fill_between(
|
90 |
+
ensemble_size,
|
91 |
+
accuracy_mean - accuracy_std,
|
92 |
+
accuracy_mean + accuracy_std,
|
93 |
+
color="#1f77b4",
|
94 |
+
alpha=0.2,
|
95 |
+
)
|
96 |
+
|
97 |
+
# Set x-axis to only display specific ticks and extend y-axis to leave space at top
|
98 |
+
plt.xticks(xticks_values, fontsize=12)
|
99 |
+
plt.yticks(fontsize=12)
|
100 |
+
plt.xlim(xlim_values) # Adjusted x-axis limit
|
101 |
+
plt.ylim(ylim_values) # Adjusted y-axis limit
|
102 |
+
|
103 |
+
# Labeling the axes
|
104 |
+
plt.xlabel(xlabel_value, fontsize=16)
|
105 |
+
plt.ylabel(ylabel_value, fontsize=16)
|
106 |
+
|
107 |
+
# ===================
|
108 |
+
# Part 4: Saving Output
|
109 |
+
# ===================
|
110 |
+
# Adjust layout and save plot
|
111 |
+
plt.tight_layout()
|
112 |
+
plt.savefig('line_37.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_38.png
ADDED
![]() |
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_40.py
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# New generated data
|
12 |
+
snr_values = np.linspace(5, 25, 5)
|
13 |
+
jpeg_ldpc = np.random.normal(loc=50, scale=5, size=5).clip(10, 90)
|
14 |
+
deepjscc_wo_ofdm = np.random.normal(loc=40, scale=10, size=5).clip(5, 45)
|
15 |
+
deepjscc_w_ofdm = np.random.normal(loc=70, scale=10, size=5).clip(20, 95)
|
16 |
+
ours = np.random.normal(loc=85, scale=5, size=5).clip(30, 100)
|
17 |
+
|
18 |
+
# Labels and Plot Types
|
19 |
+
label_jpeg_ldpc = "JPEG+LDPC"
|
20 |
+
label_deepjscc_wo_ofdm = "DEEPJSCC w/o OFDM"
|
21 |
+
label_deepjscc_w_ofdm = "DEEPJSCC w/ OFDM"
|
22 |
+
label_ours = "OURS"
|
23 |
+
|
24 |
+
# Axes Limits and Labels
|
25 |
+
yticks_values = np.arange(0, 110, 10)
|
26 |
+
ylim_values = [0, 105]
|
27 |
+
xlabel_value = "SNR"
|
28 |
+
ylabel_value = "Classification Accuracy (%)"
|
29 |
+
|
30 |
+
# ===================
|
31 |
+
# Part 3: Plot Configuration and Rendering
|
32 |
+
# ===================
|
33 |
+
# Plotting with error bars (second-level element)
|
34 |
+
plt.figure(figsize=(8, 6)) # Increased figure size for clarity
|
35 |
+
plt.plot(snr_values, jpeg_ldpc, "-o", label=label_jpeg_ldpc, color="#1f77b4")
|
36 |
+
plt.fill_between(snr_values, jpeg_ldpc - 5, jpeg_ldpc + 5, color="#1f77b4", alpha=0.2)
|
37 |
+
plt.plot(snr_values, deepjscc_wo_ofdm, "-^", label=label_deepjscc_wo_ofdm, color="#ff7f0e")
|
38 |
+
plt.fill_between(
|
39 |
+
snr_values, deepjscc_wo_ofdm - 10, deepjscc_wo_ofdm + 10, color="#ff7f0e", alpha=0.2
|
40 |
+
)
|
41 |
+
plt.plot(snr_values, deepjscc_w_ofdm, "-x", label=label_deepjscc_w_ofdm, color="#2ca02c")
|
42 |
+
plt.fill_between(
|
43 |
+
snr_values, deepjscc_w_ofdm - 10, deepjscc_w_ofdm + 10, color="#2ca02c", alpha=0.2
|
44 |
+
)
|
45 |
+
plt.plot(snr_values, ours, "-s", label=label_ours, color="#d62728")
|
46 |
+
plt.fill_between(snr_values, ours - 5, ours + 5, color="#d62728", alpha=0.2)
|
47 |
+
|
48 |
+
# Customizing axes and labels (third-level elements)
|
49 |
+
plt.yticks(yticks_values, fontsize=12)
|
50 |
+
plt.xticks(fontsize=12)
|
51 |
+
plt.ylim(ylim_values)
|
52 |
+
plt.grid(True)
|
53 |
+
|
54 |
+
# Relocating the legend to ensure no overlap with data lines
|
55 |
+
plt.legend(loc="lower right", frameon=True, shadow=True, fontsize=10)
|
56 |
+
|
57 |
+
# Customizing the background (third-level element)
|
58 |
+
plt.gca().set_facecolor("#f4f4f5")
|
59 |
+
plt.gca().spines["top"].set_visible(False)
|
60 |
+
plt.gca().spines["right"].set_visible(False)
|
61 |
+
|
62 |
+
# Labels
|
63 |
+
plt.xlabel(xlabel_value, fontsize=14)
|
64 |
+
plt.ylabel(ylabel_value, fontsize=14)
|
65 |
+
|
66 |
+
# ===================
|
67 |
+
# Part 4: Saving Output
|
68 |
+
# ===================
|
69 |
+
# Adjust layout and save the figure
|
70 |
+
plt.tight_layout()
|
71 |
+
plt.savefig('line_40.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_41.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_41.py
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Updated steps
|
12 |
+
gradient_steps = np.linspace(0, 200, 50)
|
13 |
+
|
14 |
+
# Generating distinct trends for each line
|
15 |
+
line1_values = np.sin(gradient_steps * 0.1) + 1.0 # Sinusoidal trend
|
16 |
+
line2_values = np.array(gradient_steps) ** 2 * 0.0001 + 0.5 # Quadratic growth
|
17 |
+
line3_values = np.random.normal(
|
18 |
+
loc=1.5, scale=0.2, size=len(gradient_steps)
|
19 |
+
) # Random noise
|
20 |
+
line4_values = np.exp(0.01 * gradient_steps) # Exponential growth
|
21 |
+
|
22 |
+
# Simulating standard deviations for error
|
23 |
+
std_dev = 0.1
|
24 |
+
line1_std = np.full_like(line1_values, std_dev)
|
25 |
+
line2_std = np.full_like(line2_values, std_dev)
|
26 |
+
line3_std = np.full_like(line3_values, std_dev)
|
27 |
+
line4_std = np.full_like(line4_values, std_dev)
|
28 |
+
|
29 |
+
# Axes Limits and Labels
|
30 |
+
xlabel_value = "Gradient Steps (x 62.5K)"
|
31 |
+
xlim_values = [0, 200]
|
32 |
+
xticks_values = np.linspace(0, 200, 9)
|
33 |
+
|
34 |
+
ylabel_value_1 = "Performance Value"
|
35 |
+
ylabel_value_2 = "Exponential Scale"
|
36 |
+
yticks_values_1 = np.arange(0, 5, 1)
|
37 |
+
yticks_values_2 = np.arange(0, 8, 1)
|
38 |
+
ylim_values_1 = [0, 5]
|
39 |
+
ylim_values_2 = [0, 8]
|
40 |
+
|
41 |
+
# Labels
|
42 |
+
label_1 = "Line 1 (Sinusoidal)"
|
43 |
+
label_2 = "Line 2 (Quadratic)"
|
44 |
+
label_3 = "Line 3 (Random Noise)"
|
45 |
+
|
46 |
+
|
47 |
+
# ===================
|
48 |
+
# Part 3: Plot Configuration and Rendering
|
49 |
+
# ===================
|
50 |
+
# Creating a figure with two subplots
|
51 |
+
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(6, 8))
|
52 |
+
|
53 |
+
# Plotting on the first subplot
|
54 |
+
ax1.plot(
|
55 |
+
gradient_steps, line1_values, "o-", color="purple", label=label_1
|
56 |
+
)
|
57 |
+
ax1.fill_between(
|
58 |
+
gradient_steps,
|
59 |
+
line1_values - line1_std,
|
60 |
+
line1_values + line1_std,
|
61 |
+
color="purple",
|
62 |
+
alpha=0.2,
|
63 |
+
)
|
64 |
+
|
65 |
+
ax1.plot(gradient_steps, line2_values, "s-", color="blue", label=label_2)
|
66 |
+
ax1.fill_between(
|
67 |
+
gradient_steps,
|
68 |
+
line2_values - line2_std,
|
69 |
+
line2_values + line2_std,
|
70 |
+
color="blue",
|
71 |
+
alpha=0.2,
|
72 |
+
)
|
73 |
+
|
74 |
+
ax2.plot(
|
75 |
+
gradient_steps,
|
76 |
+
line3_values,
|
77 |
+
"^--",
|
78 |
+
color="green",
|
79 |
+
markerfacecolor=(0, 0, 0, 0),
|
80 |
+
markeredgecolor="green",
|
81 |
+
label=label_3,
|
82 |
+
)
|
83 |
+
ax2.fill_between(
|
84 |
+
gradient_steps,
|
85 |
+
line3_values - line3_std,
|
86 |
+
line3_values + line3_std,
|
87 |
+
color="green",
|
88 |
+
alpha=0.2,
|
89 |
+
)
|
90 |
+
|
91 |
+
ax1.set_xlabel(xlabel_value, fontsize=12)
|
92 |
+
ax1.set_ylabel(ylabel_value_1, fontsize=12)
|
93 |
+
ax1.set_xticks(xticks_values)
|
94 |
+
ax1.set_yticks(yticks_values_1)
|
95 |
+
ax1.set_xlim(xlim_values)
|
96 |
+
ax1.set_ylim(ylim_values_1)
|
97 |
+
ax1.legend(loc="upper center", frameon=False, ncol=2, bbox_to_anchor=(0.5, 1.15))
|
98 |
+
ax1.grid(
|
99 |
+
True, which="both", axis="both", color="lightgray", linestyle="--", linewidth=0.5
|
100 |
+
)
|
101 |
+
ax1.set_facecolor("#f9f9f9")
|
102 |
+
|
103 |
+
# Plotting on the second subplot
|
104 |
+
ax2.plot(
|
105 |
+
gradient_steps, line4_values, "*-", color="red", label="Line 4 (Exponential Focus)"
|
106 |
+
)
|
107 |
+
ax2.fill_between(
|
108 |
+
gradient_steps,
|
109 |
+
line4_values - line4_std,
|
110 |
+
line4_values + line4_std,
|
111 |
+
color="red",
|
112 |
+
alpha=0.2,
|
113 |
+
)
|
114 |
+
ax2.set_xlabel(xlabel_value, fontsize=12)
|
115 |
+
ax2.set_ylabel(ylabel_value_2, fontsize=12)
|
116 |
+
ax2.set_xticks(xticks_values)
|
117 |
+
ax2.set_yticks(yticks_values_2)
|
118 |
+
ax2.set_xlim(xlim_values)
|
119 |
+
ax2.set_ylim(ylim_values_2)
|
120 |
+
ax2.legend(loc="upper center", frameon=False, ncol=2, bbox_to_anchor=(0.5, 1.15))
|
121 |
+
ax2.grid(
|
122 |
+
True, which="both", axis="both", color="lightgray", linestyle="--", linewidth=0.5
|
123 |
+
)
|
124 |
+
ax2.set_facecolor("#f9f9f9")
|
125 |
+
|
126 |
+
# ===================
|
127 |
+
# Part 4: Saving Output
|
128 |
+
# ===================
|
129 |
+
plt.tight_layout()
|
130 |
+
plt.savefig('line_41.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_42.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_42.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
gradient_steps = np.array([0, 50, 100, 150, 200])
|
13 |
+
line1_values = np.array([0.1, 0.8, 1.2, 1.5, 1.3])
|
14 |
+
line2_values = np.array([1.0, 0.5, 0.8, 1.0, 1.8])
|
15 |
+
line3_values = np.array([1.8, 1.2, 0.5, 0.4, 0.3])
|
16 |
+
line4_values = np.poly1d(np.polyfit(gradient_steps, line2_values, 3))(
|
17 |
+
gradient_steps
|
18 |
+
) # Polynomial trend
|
19 |
+
|
20 |
+
# Axes Limits and Labels
|
21 |
+
xlabel_value = "Gradient Steps (x 62.5K)"
|
22 |
+
|
23 |
+
ylabel_value_1 = "Value"
|
24 |
+
ylabel_value_2 = "Polynomial Value"
|
25 |
+
yticks_values_1 = np.arange(0, 2.1, 0.5)
|
26 |
+
yticks_values_2 = np.arange(min(line4_values), max(line4_values) + 0.1, 0.2)
|
27 |
+
|
28 |
+
# Labels
|
29 |
+
label_1 = "Line 1"
|
30 |
+
label_2 = "Line 2"
|
31 |
+
label_3 = "Polynomial Trend (from Line 2)"
|
32 |
+
|
33 |
+
# ===================
|
34 |
+
# Part 3: Plot Configuration and Rendering
|
35 |
+
# ===================
|
36 |
+
# Create subplots
|
37 |
+
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))
|
38 |
+
|
39 |
+
# First subplot
|
40 |
+
ax1.plot(gradient_steps, line1_values, "o-", color="orange", label=label_1)
|
41 |
+
ax1.plot(gradient_steps, line2_values, "s-", color="blue", label=label_2)
|
42 |
+
ax1.set_xlabel(xlabel_value)
|
43 |
+
ax1.set_ylabel(ylabel_value_1)
|
44 |
+
ax1.set_xticks(gradient_steps)
|
45 |
+
ax1.set_yticks(yticks_values_1)
|
46 |
+
ax1.legend(loc="upper left")
|
47 |
+
ax1.grid(True)
|
48 |
+
|
49 |
+
# Second subplot
|
50 |
+
ax2.plot(gradient_steps, line3_values, "^--", color="green", label="Line 3")
|
51 |
+
ax2.plot(gradient_steps, line4_values, "*-m", label=label_3)
|
52 |
+
ax2.set_xlabel(xlabel_value)
|
53 |
+
ax2.set_ylabel(ylabel_value_2)
|
54 |
+
ax2.set_xticks(gradient_steps)
|
55 |
+
ax2.set_yticks(yticks_values_2)
|
56 |
+
ax2.legend(loc="upper right")
|
57 |
+
ax2.grid(True)
|
58 |
+
|
59 |
+
# Annotations and styling
|
60 |
+
for ax in (ax1, ax2):
|
61 |
+
ax.spines["left"].set_position(("outward", 10))
|
62 |
+
ax.spines["bottom"].set_position(("outward", 10))
|
63 |
+
ax.spines["right"].set_color("none")
|
64 |
+
ax.spines["top"].set_color("none")
|
65 |
+
for x, y in zip(gradient_steps, line1_values):
|
66 |
+
ax1.annotate(
|
67 |
+
f"{y:.1f}", xy=(x, y), textcoords="offset points", xytext=(0, 10), ha="center"
|
68 |
+
)
|
69 |
+
|
70 |
+
# ===================
|
71 |
+
# Part 4: Saving Output
|
72 |
+
# ===================
|
73 |
+
plt.tight_layout()
|
74 |
+
plt.savefig('line_42.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_43.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_43.py
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Simulated data
|
12 |
+
collab_x = np.array(
|
13 |
+
["All", "MLP", "GCN", "NCN", "NCNC", "NeoGNN-BUDDY", "SEAL", "Node2Vec"]
|
14 |
+
)
|
15 |
+
collab_y = np.array([75, 73, 72, 70, 69, 71, 73, 74])
|
16 |
+
collab_err = np.array([2, 3, 1, 1, 2, 2, 3, 2])
|
17 |
+
collab_y2 = np.array(
|
18 |
+
[67, 65, 64, 62, 61, 63, 65, 66]
|
19 |
+
) # Adjusted data for clear spacing
|
20 |
+
collab_err2 = np.array([3, 3, 1, 2, 2, 3, 3, 4])
|
21 |
+
|
22 |
+
ppa_x = np.array(
|
23 |
+
["All", "MLP", "GCN", "NCN", "NCNC", "NeoGNN-BUDDY", "SEAL", "Node2Vec"]
|
24 |
+
)
|
25 |
+
ppa_y = np.array([65, 63, 62, 60, 59, 61, 63, 64])
|
26 |
+
ppa_err = np.array([3, 2, 1, 2, 3, 2, 2, 1])
|
27 |
+
ppa_y2 = np.array([70, 69, 69, 68, 67, 69, 70, 68]) # Adjusted data for clear spacing
|
28 |
+
ppa_err2 = np.array([2, 3, 1, 1, 2, 2, 3, 2])
|
29 |
+
|
30 |
+
# Axes Limits and Labels
|
31 |
+
ylabel_value = "Hits@50"
|
32 |
+
ylim_values = [55, 80]
|
33 |
+
yticks_values = np.arange(55, 81, 5)
|
34 |
+
|
35 |
+
# Labels
|
36 |
+
label_1 = "ogbl-collab 2022"
|
37 |
+
label_2 = "ogbl-collab 2023"
|
38 |
+
label_3 = "ogbl-ppa 2022"
|
39 |
+
label_4 = "ogbl-ppa 2023"
|
40 |
+
|
41 |
+
# Titles
|
42 |
+
title_1 = "ogbl-collab Results"
|
43 |
+
title_2 = "ogbl-ppa Results"
|
44 |
+
|
45 |
+
# ===================
|
46 |
+
# Part 3: Plot Configuration and Rendering
|
47 |
+
# ===================
|
48 |
+
# Create a subplot layout of 1x2
|
49 |
+
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5), sharey=True)
|
50 |
+
|
51 |
+
# First subplot for ogbl-collab
|
52 |
+
ax1.errorbar(
|
53 |
+
collab_x,
|
54 |
+
collab_y,
|
55 |
+
yerr=collab_err,
|
56 |
+
fmt="o-",
|
57 |
+
label=label_1,
|
58 |
+
color="#3d89be",
|
59 |
+
capsize=5,
|
60 |
+
)
|
61 |
+
ax1.errorbar(
|
62 |
+
collab_x,
|
63 |
+
collab_y2,
|
64 |
+
yerr=collab_err2,
|
65 |
+
fmt="^-",
|
66 |
+
label=label_2,
|
67 |
+
color="#00BFFF",
|
68 |
+
capsize=5,
|
69 |
+
)
|
70 |
+
ax1.set_title(title_1)
|
71 |
+
ax1.set_xticks(collab_x)
|
72 |
+
ax1.set_xticklabels(collab_x, rotation=45, ha="right", fontsize=12)
|
73 |
+
ax1.set_yticks(yticks_values)
|
74 |
+
ax1.set_ylim(ylim_values)
|
75 |
+
ax1.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.5)
|
76 |
+
ax1.set_ylabel(ylabel_value, fontsize=16)
|
77 |
+
ax1.legend(loc="lower left", fontsize=12)
|
78 |
+
|
79 |
+
# Second subplot for ogbl-ppa
|
80 |
+
ax2.errorbar(
|
81 |
+
ppa_x,
|
82 |
+
ppa_y,
|
83 |
+
yerr=ppa_err,
|
84 |
+
fmt="s--",
|
85 |
+
label=label_3,
|
86 |
+
color="#ff7f0e",
|
87 |
+
capsize=5,
|
88 |
+
)
|
89 |
+
ax2.errorbar(
|
90 |
+
ppa_x,
|
91 |
+
ppa_y2,
|
92 |
+
yerr=ppa_err2,
|
93 |
+
fmt="o-.",
|
94 |
+
label=label_4,
|
95 |
+
color="#FFA500",
|
96 |
+
capsize=5,
|
97 |
+
)
|
98 |
+
ax2.set_title(title_2)
|
99 |
+
ax2.set_xticks(ppa_x)
|
100 |
+
ax2.set_xticklabels(ppa_x, rotation=45, ha="right", fontsize=12)
|
101 |
+
ax2.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.5)
|
102 |
+
ax2.legend(loc="upper left", fontsize=12)
|
103 |
+
|
104 |
+
# ===================
|
105 |
+
# Part 4: Saving Output
|
106 |
+
# ===================
|
107 |
+
# Enhance overall layout
|
108 |
+
plt.tight_layout()
|
109 |
+
plt.savefig('line_43.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_44.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_44.py
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, using random noise to add variability
|
12 |
+
N = np.array([10, 20, 30, 40, 50, 60])
|
13 |
+
standard = np.power(10, -np.linspace(10, 6, len(N)))
|
14 |
+
constrained = np.full_like(standard, 1e-12)
|
15 |
+
|
16 |
+
# New random data for variability
|
17 |
+
experimental = np.power(10, -np.random.uniform(1, 6, len(N)))
|
18 |
+
hypothetical = np.power(10, -np.linspace(1.5, 6.5, len(N)))
|
19 |
+
|
20 |
+
# Axes Limits and Labels
|
21 |
+
xlabel_value = "N"
|
22 |
+
|
23 |
+
ylabel_value = "Precision"
|
24 |
+
|
25 |
+
# Labels
|
26 |
+
label_Standard="Standard"
|
27 |
+
label_Constrained="Constrained"
|
28 |
+
label_Experimental="Experimental"
|
29 |
+
label_Hypothetical="Hypothetical"
|
30 |
+
|
31 |
+
# ===================
|
32 |
+
# Part 3: Plot Configuration and Rendering
|
33 |
+
# ===================
|
34 |
+
# Set the figure size
|
35 |
+
plt.figure(figsize=(10, 6))
|
36 |
+
|
37 |
+
# Plot the data using different styles and colors
|
38 |
+
plt.loglog(
|
39 |
+
N,
|
40 |
+
standard,
|
41 |
+
"o-",
|
42 |
+
color="#1f77b4",
|
43 |
+
label=label_Standard,
|
44 |
+
markerfacecolor="#1f77b4",
|
45 |
+
markersize=8,
|
46 |
+
linewidth=2,
|
47 |
+
)
|
48 |
+
plt.loglog(
|
49 |
+
N,
|
50 |
+
constrained,
|
51 |
+
"x-",
|
52 |
+
color="#ff7f0e",
|
53 |
+
label=label_Constrained,
|
54 |
+
markersize=8,
|
55 |
+
linewidth=2,
|
56 |
+
)
|
57 |
+
plt.loglog(
|
58 |
+
N,
|
59 |
+
experimental,
|
60 |
+
"s--",
|
61 |
+
color="green",
|
62 |
+
label=label_Experimental,
|
63 |
+
markersize=8,
|
64 |
+
linewidth=2,
|
65 |
+
)
|
66 |
+
plt.loglog(
|
67 |
+
N,
|
68 |
+
hypothetical,
|
69 |
+
"^-",
|
70 |
+
color="purple",
|
71 |
+
label=label_Hypothetical,
|
72 |
+
markersize=8,
|
73 |
+
linewidth=2,
|
74 |
+
)
|
75 |
+
|
76 |
+
# Customize the x and y axes limits and labels
|
77 |
+
plt.xlabel(xlabel_value, fontsize=14)
|
78 |
+
plt.ylabel(ylabel_value, fontsize=14)
|
79 |
+
plt.xticks(N, labels=[str(n) for n in N]) # Ensuring x-ticks match the N values
|
80 |
+
plt.xlim(
|
81 |
+
left=N[0] * 0.9, right=N[-1] * 1.1
|
82 |
+
) # Set x-axis limits to prevent cutting off data points
|
83 |
+
plt.ylim(
|
84 |
+
bottom=1e-14, top=1e-1
|
85 |
+
) # Extend y-axis to leave some space above and below the data
|
86 |
+
|
87 |
+
# Adjust the legend position
|
88 |
+
plt.legend(bbox_to_anchor=(1, 0.5), fontsize=12, frameon=True)
|
89 |
+
|
90 |
+
# Add grid lines for better readability
|
91 |
+
plt.grid(True, which="both", ls="--", color="grey", linewidth=1, alpha=0.5)
|
92 |
+
|
93 |
+
# ===================
|
94 |
+
# Part 4: Saving Output
|
95 |
+
# ===================
|
96 |
+
# Adjust the layout and save the plot
|
97 |
+
plt.tight_layout()
|
98 |
+
plt.savefig('line_44.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_46.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_46.py
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# ===================
|
9 |
+
# Part 2: Data Preparation
|
10 |
+
# ===================
|
11 |
+
# New data for plotting, representing some scientific or business metrics
|
12 |
+
|
13 |
+
times = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0]
|
14 |
+
activity_standard = [0.0, 0.91, 0.95, 0.14, -0.73, -1.01, -0.27, 0.76, 1.17, 0.39, -0.61, -1.01, -0.55, 0.49, 0.82, 0.54, -0.23, -1.09, -0.83, 0.17, 1.09, 0.94, -0.01, -0.94, -0.77]
|
15 |
+
activity_innovative = [1.06, 0.46, -0.49, -1.0, -0.63, 0.26, 1.07, 0.74, -0.15, -0.74, -0.88, 0.0, 0.88, 1.07, 0.15, -0.72, -0.93, -0.3, 0.54, 1.05, 0.44, -0.48, -0.85, -0.49, 0.4]
|
16 |
+
|
17 |
+
# Extracted variables
|
18 |
+
line_label1 = "Standard Activity"
|
19 |
+
line_label2 = "Innovative Activity"
|
20 |
+
xlim_values = (0, 25)
|
21 |
+
ylim_values = (-1.5, 1.5)
|
22 |
+
xlabel_value = "Time (Hours)"
|
23 |
+
ylabel_value = "Activity Level"
|
24 |
+
yticks_values = [-1.5, -1.0, -0.5, 0, 0.5, 1, 1.5]
|
25 |
+
title1 = "Daytime Activity Monitoring"
|
26 |
+
title2 = "Nighttime Activity Monitoring"
|
27 |
+
legend_location = "lower center"
|
28 |
+
legend_bbox_to_anchor = (0.5, -0.2)
|
29 |
+
legend_frameon = False
|
30 |
+
|
31 |
+
# ===================
|
32 |
+
# Part 3: Plot Configuration and Rendering
|
33 |
+
# ===================
|
34 |
+
# Set the figure size
|
35 |
+
fig, axs = plt.subplots(
|
36 |
+
2, 1, figsize=(6, 10)
|
37 |
+
) # Use a 1x2 subplot grid for horizontal layout
|
38 |
+
|
39 |
+
# Define new colors and markers for a fresh look
|
40 |
+
colors = ["dodgerblue", "crimson"]
|
41 |
+
linestyles = ["-", "--"]
|
42 |
+
labels = [line_label1, line_label2]
|
43 |
+
|
44 |
+
# First subplot with area fill
|
45 |
+
axs[0].plot(
|
46 |
+
times, activity_standard, color=colors[0], linestyle=linestyles[0], label=labels[0]
|
47 |
+
)
|
48 |
+
axs[0].set_title(title1)
|
49 |
+
axs[0].set_xlabel(xlabel_value)
|
50 |
+
axs[0].set_ylabel(ylabel_value)
|
51 |
+
axs[0].set_xlim(xlim_values)
|
52 |
+
axs[0].set_ylim(ylim_values)
|
53 |
+
axs[0].set_yticks(yticks_values)
|
54 |
+
axs[0].legend(loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon)
|
55 |
+
axs[0].tick_params(axis="both", which="both", length=0)
|
56 |
+
|
57 |
+
# Second subplot with gradient fill emulation
|
58 |
+
axs[1].plot(
|
59 |
+
times,
|
60 |
+
activity_innovative,
|
61 |
+
color=colors[1],
|
62 |
+
linestyle=linestyles[1],
|
63 |
+
label=labels[1],
|
64 |
+
)
|
65 |
+
axs[1].set_title(title2)
|
66 |
+
axs[1].set_xlabel(xlabel_value)
|
67 |
+
axs[1].set_ylabel(ylabel_value)
|
68 |
+
axs[1].set_ylim(ylim_values)
|
69 |
+
axs[1].set_xlim(xlim_values)
|
70 |
+
axs[1].set_yticks(yticks_values)
|
71 |
+
axs[1].legend(loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon)
|
72 |
+
axs[1].tick_params(axis="both", which="both", length=0)
|
73 |
+
|
74 |
+
# ===================
|
75 |
+
# Part 4: Saving Output
|
76 |
+
# ===================
|
77 |
+
# Enhance overall layout and visuals
|
78 |
+
plt.tight_layout()
|
79 |
+
plt.savefig('line_46.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_47.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_47.py
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Generate new data representing different types of performance metrics over time
|
12 |
+
time_points = np.linspace(0, 12, 100) # Representing time in months
|
13 |
+
performance_standard = 0.5 * np.sin(2 * np.pi * time_points / 12) + 0.5
|
14 |
+
performance_innovation = 0.5 * np.cos(2 * np.pi * time_points / 12) + 0.5
|
15 |
+
|
16 |
+
# Calculate uncertainty bounds for visual emphasis
|
17 |
+
upper_bound_standard = performance_standard + 0.1
|
18 |
+
lower_bound_standard = performance_standard - 0.1
|
19 |
+
upper_bound_innovation = performance_innovation + 0.1
|
20 |
+
lower_bound_innovation = performance_innovation - 0.1
|
21 |
+
|
22 |
+
# Axes Limits and Labels
|
23 |
+
xlabel_value = "Time (Months)"
|
24 |
+
xlim_values = [5, 25]
|
25 |
+
xticks_values = np.arange(0, 13, 1)
|
26 |
+
|
27 |
+
ylabel_value = "Performance Index"
|
28 |
+
ylim_values = [0, 1.1]
|
29 |
+
yticks_values = np.linspace(0, 1, 6)
|
30 |
+
|
31 |
+
# Labels
|
32 |
+
label_1 = "Standard Performance"
|
33 |
+
label_2 = "Innovative Performance"
|
34 |
+
|
35 |
+
# Title
|
36 |
+
title = "Comparative Performance Analysis Over Time"
|
37 |
+
|
38 |
+
# ===================
|
39 |
+
# Part 3: Plot Configuration and Rendering
|
40 |
+
# ===================
|
41 |
+
# Set the figure size and create a single plot
|
42 |
+
fig, ax = plt.subplots(figsize=(10, 6))
|
43 |
+
|
44 |
+
# Plot the standard performance with filled uncertainty
|
45 |
+
ax.fill_between(
|
46 |
+
time_points,
|
47 |
+
lower_bound_standard,
|
48 |
+
upper_bound_standard,
|
49 |
+
color="lightblue",
|
50 |
+
alpha=0.3,
|
51 |
+
)
|
52 |
+
ax.plot(
|
53 |
+
time_points,
|
54 |
+
performance_standard,
|
55 |
+
label=label_1,
|
56 |
+
color="blue",
|
57 |
+
linestyle="-",
|
58 |
+
linewidth=2,
|
59 |
+
)
|
60 |
+
|
61 |
+
# Plot the innovative performance with filled uncertainty
|
62 |
+
ax.fill_between(
|
63 |
+
time_points,
|
64 |
+
lower_bound_innovation,
|
65 |
+
upper_bound_innovation,
|
66 |
+
color="lightcoral",
|
67 |
+
alpha=0.3,
|
68 |
+
)
|
69 |
+
ax.plot(
|
70 |
+
time_points,
|
71 |
+
performance_innovation,
|
72 |
+
label=label_2,
|
73 |
+
color="red",
|
74 |
+
linestyle="-",
|
75 |
+
linewidth=2,
|
76 |
+
)
|
77 |
+
|
78 |
+
# Customize the axes and grid
|
79 |
+
ax.set_title(title)
|
80 |
+
ax.set_xlabel(xlabel_value, fontsize=14)
|
81 |
+
ax.set_ylabel(ylabel_value, fontsize=14)
|
82 |
+
ax.set_ylim(ylim_values)
|
83 |
+
ax.set_xticks(xticks_values)
|
84 |
+
ax.set_yticks(yticks_values)
|
85 |
+
|
86 |
+
# Add a legend to the plot
|
87 |
+
ax.legend(loc="upper right", frameon=True, fontsize=12)
|
88 |
+
|
89 |
+
# ===================
|
90 |
+
# Part 4: Saving Output
|
91 |
+
# ===================
|
92 |
+
# Enhance layout and display
|
93 |
+
plt.tight_layout()
|
94 |
+
plt.savefig('line_47.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_48.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_48.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Generate new data for a complex scenario
|
12 |
+
months = np.arange(1, 13, 1) # Months of the year
|
13 |
+
sales = np.random.normal(1055, 250, len(months)) # Simulate monthly sales
|
14 |
+
temperature = (
|
15 |
+
5 * np.sin(0.5 * np.pi * months / 12) + 20
|
16 |
+
) # Simulate average monthly temperature
|
17 |
+
|
18 |
+
# Axes Limits and Labels
|
19 |
+
xlabel_value = "Month"
|
20 |
+
|
21 |
+
ylabel_value_1 = "Sales"
|
22 |
+
ylabel_value_2 = "Temperature (°C)"
|
23 |
+
|
24 |
+
# Labels
|
25 |
+
label_1 = "Monthly Sales"
|
26 |
+
label_2 = "Average Temperature"
|
27 |
+
|
28 |
+
# Titles
|
29 |
+
title = "Sales and Temperature Correlation Over a Year"
|
30 |
+
|
31 |
+
# ===================
|
32 |
+
# Part 3: Plot Configuration and Rendering
|
33 |
+
# ===================
|
34 |
+
# Create the main figure and axis
|
35 |
+
fig, ax1 = plt.subplots(figsize=(10, 6))
|
36 |
+
|
37 |
+
# Plot sales data with primary axis
|
38 |
+
color = "tab:blue"
|
39 |
+
ax1.set_xlabel(xlabel_value)
|
40 |
+
ax1.set_ylabel(ylabel_value_1, color=color)
|
41 |
+
ax1.plot(months, sales, label=label_1, color=color, marker="o", linestyle="-")
|
42 |
+
ax1.tick_params(axis="y", labelcolor=color)
|
43 |
+
ax1.set_xticks(months)
|
44 |
+
ax1.set_title(title)
|
45 |
+
|
46 |
+
# Create a second y-axis for temperature
|
47 |
+
ax2 = ax1.twinx() # Instantiate a second axes that shares the same x-axis
|
48 |
+
color = "tab:red"
|
49 |
+
ax2.set_ylabel(
|
50 |
+
ylabel_value_2, color=color
|
51 |
+
) # We already handled the x-label with ax1
|
52 |
+
ax2.plot(
|
53 |
+
months,
|
54 |
+
temperature,
|
55 |
+
label=label_2,
|
56 |
+
color=color,
|
57 |
+
marker="s",
|
58 |
+
linestyle="--",
|
59 |
+
)
|
60 |
+
ax2.tick_params(axis="y", labelcolor=color)
|
61 |
+
|
62 |
+
# Add legends to the plot
|
63 |
+
lines, labels = ax1.get_legend_handles_labels()
|
64 |
+
lines2, labels2 = ax2.get_legend_handles_labels()
|
65 |
+
ax1.legend(lines + lines2, labels + labels2, loc="upper left", frameon=True)
|
66 |
+
|
67 |
+
# ===================
|
68 |
+
# Part 4: Saving Output
|
69 |
+
# ===================
|
70 |
+
# Adjust layout for better spacing and display
|
71 |
+
plt.tight_layout()
|
72 |
+
|
73 |
+
# Show the plot
|
74 |
+
plt.savefig('line_48.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_49.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_49.py
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 preparation
|
13 |
+
|
14 |
+
times = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
|
15 |
+
growth = [1.18, 0.76, 0.61, 0.59, 0.45, 0.09, 0.23, 0.08, 0.06, 0.09, 0.05]
|
16 |
+
decay = [1.07, 0.41, 0.14, 0.07, 0.03, 0.08, -0.01, 0.02, -0.04, -0.13, 0.03]
|
17 |
+
oscillation = [0.09, 0.77, 1.14, -0.0, -0.75, -0.98, -0.13, 0.8, 1.0, 0.45, -0.63]
|
18 |
+
|
19 |
+
# Extracted variables
|
20 |
+
growth_label = "Growth"
|
21 |
+
decay_label = "Decay"
|
22 |
+
oscillation_label = "Oscillation"
|
23 |
+
|
24 |
+
xlim_values = (0, 10)
|
25 |
+
ylim_values_growth = (-0.2, 1.3)
|
26 |
+
ylim_values_decay = (-0.2, 1.3)
|
27 |
+
ylim_values_oscillation = (-1.2, 1.2)
|
28 |
+
|
29 |
+
yticks_growth = [-0.2, 0.3, 0.8, 1.3]
|
30 |
+
yticks_decay = [-0.2, 0.3, 0.8, 1.3]
|
31 |
+
yticks_oscillation = [-1.2, -1, 0, 1, 1.2]
|
32 |
+
|
33 |
+
xlabel_value = "Time"
|
34 |
+
ylabel_value = "Value"
|
35 |
+
|
36 |
+
title_growth = "Exponential Growth Over Time"
|
37 |
+
title_decay = "Exponential Decay Over Time"
|
38 |
+
title_oscillation = "Oscillatory Behavior Over Time"
|
39 |
+
|
40 |
+
legend_location = "upper center"
|
41 |
+
legend_bbox_to_anchor = (0.5, 1.15)
|
42 |
+
legend_frameon = False
|
43 |
+
|
44 |
+
grid_linestyle = "--"
|
45 |
+
grid_alpha = 0.5
|
46 |
+
|
47 |
+
tick_params_color = "gray"
|
48 |
+
|
49 |
+
# ===================
|
50 |
+
# Part 3: Plot Configuration and Rendering
|
51 |
+
# ===================
|
52 |
+
# Create a 3-subplot layout
|
53 |
+
fig, axs = plt.subplots(3, 1, figsize=(6, 9))
|
54 |
+
|
55 |
+
# First subplot: Growth
|
56 |
+
axs[0].plot(
|
57 |
+
times,
|
58 |
+
growth,
|
59 |
+
label=growth_label,
|
60 |
+
color="green",
|
61 |
+
clip_on=False,
|
62 |
+
zorder=10,
|
63 |
+
linestyle="-",
|
64 |
+
marker="o",
|
65 |
+
)
|
66 |
+
axs[0].set_title(title_growth, y=1.1)
|
67 |
+
axs[0].set_xlim(*xlim_values)
|
68 |
+
axs[0].set_ylim(*ylim_values_growth)
|
69 |
+
axs[0].set_yticks(yticks_growth)
|
70 |
+
axs[0].set_ylabel(ylabel_value)
|
71 |
+
axs[0].legend(
|
72 |
+
loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon
|
73 |
+
)
|
74 |
+
axs[0].grid(True, linestyle=grid_linestyle, alpha=grid_alpha)
|
75 |
+
axs[0].tick_params(axis="both", which="both", color=tick_params_color)
|
76 |
+
|
77 |
+
# Second subplot: Decay
|
78 |
+
axs[1].plot(
|
79 |
+
times,
|
80 |
+
decay,
|
81 |
+
label=decay_label,
|
82 |
+
color="red",
|
83 |
+
clip_on=False,
|
84 |
+
zorder=10,
|
85 |
+
linestyle="-",
|
86 |
+
marker="x",
|
87 |
+
)
|
88 |
+
axs[1].set_xlim(*xlim_values)
|
89 |
+
axs[1].set_ylim(*ylim_values_decay)
|
90 |
+
axs[1].set_yticks(yticks_decay)
|
91 |
+
axs[1].set_title(title_decay, y=1.1)
|
92 |
+
axs[1].set_ylabel(ylabel_value)
|
93 |
+
axs[1].legend(
|
94 |
+
loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon
|
95 |
+
)
|
96 |
+
axs[1].grid(True, linestyle=grid_linestyle, alpha=grid_alpha)
|
97 |
+
axs[1].tick_params(axis="both", which="both", color=tick_params_color)
|
98 |
+
|
99 |
+
# Third subplot: Oscillation
|
100 |
+
axs[2].plot(
|
101 |
+
times,
|
102 |
+
oscillation,
|
103 |
+
label=oscillation_label,
|
104 |
+
clip_on=False,
|
105 |
+
zorder=10,
|
106 |
+
color="blue",
|
107 |
+
linestyle="-",
|
108 |
+
marker="s",
|
109 |
+
)
|
110 |
+
axs[2].set_title(title_oscillation, y=1.1)
|
111 |
+
axs[2].set_xlim(*xlim_values)
|
112 |
+
axs[2].set_ylim(*ylim_values_oscillation)
|
113 |
+
axs[2].set_yticks(yticks_oscillation)
|
114 |
+
axs[2].set_xlabel(xlabel_value)
|
115 |
+
axs[2].set_ylabel(ylabel_value)
|
116 |
+
axs[2].legend(
|
117 |
+
loc=legend_location, bbox_to_anchor=legend_bbox_to_anchor, frameon=legend_frameon
|
118 |
+
)
|
119 |
+
axs[2].grid(True, linestyle=grid_linestyle, alpha=grid_alpha)
|
120 |
+
axs[2].tick_params(
|
121 |
+
axis="both",
|
122 |
+
which="both",
|
123 |
+
color=tick_params_color,
|
124 |
+
)
|
125 |
+
|
126 |
+
# ===================
|
127 |
+
# Part 4: Saving Output
|
128 |
+
# ===================
|
129 |
+
# Adjust layout for better spacing and display
|
130 |
+
plt.tight_layout()
|
131 |
+
|
132 |
+
# Show the plot
|
133 |
+
plt.savefig("line_49.pdf", bbox_inches="tight")
|
ChartMimic/dataset/ori_500/line_50.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_50.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
x = np.linspace(0, 20, 20)
|
12 |
+
original_data = np.sin(x) + np.random.normal(
|
13 |
+
0, 0.1, 20
|
14 |
+
) # Original data with some noise
|
15 |
+
smoothed_data = np.convolve(
|
16 |
+
original_data, np.ones(5) / 5, mode="valid"
|
17 |
+
) # Smoothed data
|
18 |
+
difference_data = np.diff(original_data) # Difference data
|
19 |
+
cumulative_data = np.cumsum(original_data) # Cumulative sum data
|
20 |
+
|
21 |
+
# Axes Limits and Labels
|
22 |
+
xlabel_value = "Time"
|
23 |
+
|
24 |
+
ylabel_value_1 = "Value"
|
25 |
+
ylabel_value_2 = "Delta Value"
|
26 |
+
ylabel_value_3 = "Cumulative Value"
|
27 |
+
|
28 |
+
# Labels
|
29 |
+
label_1 = "Smoothed Data"
|
30 |
+
label_2 = "Difference Data"
|
31 |
+
label_3 = "Cumulative Sum"
|
32 |
+
|
33 |
+
# Titles
|
34 |
+
title_1 = "Smoothed Representation"
|
35 |
+
title_2 = "First Difference of Data"
|
36 |
+
title_3 = "Cumulative Sum Over Time"
|
37 |
+
|
38 |
+
# ===================
|
39 |
+
# Part 3: Plot Configuration and Rendering
|
40 |
+
# ===================
|
41 |
+
# Create a 3-subplot layout
|
42 |
+
fig, axs = plt.subplots(3, 1, figsize=(5, 10))
|
43 |
+
|
44 |
+
# First subplot: Smoothed Data
|
45 |
+
axs[0].plot(
|
46 |
+
x[2:-2],
|
47 |
+
smoothed_data,
|
48 |
+
label=label_1,
|
49 |
+
color="purple",
|
50 |
+
linestyle="-",
|
51 |
+
marker="o",
|
52 |
+
)
|
53 |
+
axs[0].set_title(title_1)
|
54 |
+
axs[0].set_ylabel(ylabel_value_1)
|
55 |
+
axs[0].legend(loc="upper right")
|
56 |
+
axs[0].grid(True, linestyle="--", alpha=0.5)
|
57 |
+
|
58 |
+
# Second subplot: Difference Data
|
59 |
+
axs[1].plot(
|
60 |
+
x[1:],
|
61 |
+
difference_data,
|
62 |
+
label=label_2,
|
63 |
+
color="orange",
|
64 |
+
linestyle="-",
|
65 |
+
marker="x",
|
66 |
+
)
|
67 |
+
axs[1].set_title(title_2)
|
68 |
+
axs[1].set_ylabel(ylabel_value_2)
|
69 |
+
axs[1].legend(loc="upper right")
|
70 |
+
axs[1].grid(True, linestyle="--", alpha=0.5)
|
71 |
+
|
72 |
+
# Third subplot: Cumulative Sum
|
73 |
+
axs[2].plot(
|
74 |
+
x, cumulative_data, label=label_3, color="green", linestyle="-", marker="s"
|
75 |
+
)
|
76 |
+
axs[2].set_title(title_3)
|
77 |
+
axs[2].set_xlabel(xlabel_value)
|
78 |
+
axs[2].set_ylabel(ylabel_value_3)
|
79 |
+
axs[2].legend(loc="upper right")
|
80 |
+
axs[2].grid(True, linestyle="--", alpha=0.5)
|
81 |
+
|
82 |
+
# ===================
|
83 |
+
# Part 4: Saving Output
|
84 |
+
# ===================
|
85 |
+
# Adjust layout for better spacing and display
|
86 |
+
plt.tight_layout()
|
87 |
+
|
88 |
+
# Show the plot
|
89 |
+
plt.savefig('line_50.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_51.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_51.py
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# ===================
|
9 |
+
# Part 2: Data Preparation
|
10 |
+
# ===================
|
11 |
+
t = [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0]
|
12 |
+
y1 = [0.18, 0.52, 0.94, 1.22, 1.1, 0.5, 0.24, -0.37, -0.77, -0.94, -0.94, -0.56, -0.2, 0.23, 0.7, 0.97, 1.14, 0.78, 0.44, -0.16, -0.8]
|
13 |
+
y2 = [1.07, 0.96, 0.47, 0.3, -0.56, -0.8, -1.01, -0.78, -0.51, -0.2, 0.32, 0.62, 0.76, 0.94, 0.77, 0.47, -0.03, -0.64, -0.94, -1.1, -0.98]
|
14 |
+
y3 = [-0.17, 0.62, 0.67, 0.87, 0.9, 1.16, 0.94, 1.07, 0.96, 1.04, 0.89, 0.76, 0.81, 0.79, 0.69, 0.65, 0.49, 0.46, 0.38, 0.36, 0.28]
|
15 |
+
y4 = [-0.17, 0.42, 0.65, 0.75, 1.14, 1.16, 1.39, 1.58, 1.62, 1.82, 1.67, 1.91, 1.88, 1.93, 2.02, 2.11, 2.2, 2.13, 2.39, 2.4, 2.24]
|
16 |
+
|
17 |
+
|
18 |
+
# Labels for legend
|
19 |
+
label_sin_wave = "Sin Wave"
|
20 |
+
label_cos_wave = "Cos Wave"
|
21 |
+
label_exp_decay = "Exp Decay"
|
22 |
+
label_log_growth = "Log Growth"
|
23 |
+
|
24 |
+
# Plot configuration
|
25 |
+
xlim_values = (0, 10)
|
26 |
+
ylim_values_sin_cos = (-1.5, 1.5)
|
27 |
+
ylim_values_exp = (-0.2, 1.2)
|
28 |
+
ylim_values_log = (0, 2.5)
|
29 |
+
|
30 |
+
xlabel_value = "Time"
|
31 |
+
ylabel_value = "Amplitude"
|
32 |
+
ylabel_value_exp_log = "Value"
|
33 |
+
|
34 |
+
title_sin = "Sinusoidal Pattern"
|
35 |
+
title_cos = "Cosine Pattern"
|
36 |
+
title_exp = "Exponential Decay"
|
37 |
+
title_log = "Logarithmic Growth"
|
38 |
+
|
39 |
+
# ===================
|
40 |
+
# Part 3: Plot Configuration and Rendering
|
41 |
+
# ===================
|
42 |
+
fig, axs = plt.subplots(4, 1, figsize=(6, 12))
|
43 |
+
|
44 |
+
axs[0].plot(t, y1, label=label_sin_wave, color="magenta")
|
45 |
+
axs[0].set_xlim(*xlim_values)
|
46 |
+
axs[0].set_ylim(*ylim_values_sin_cos)
|
47 |
+
axs[0].set_title(title_sin, y=1.1)
|
48 |
+
axs[0].set_xlabel(xlabel_value)
|
49 |
+
axs[0].set_ylabel(ylabel_value)
|
50 |
+
|
51 |
+
axs[1].plot(t, y2, label=label_cos_wave, color="green")
|
52 |
+
axs[1].set_xlim(*xlim_values)
|
53 |
+
axs[1].set_ylim(*ylim_values_sin_cos)
|
54 |
+
axs[1].set_title(title_cos, y=1.1)
|
55 |
+
axs[1].set_xlabel(xlabel_value)
|
56 |
+
axs[1].set_ylabel(ylabel_value)
|
57 |
+
|
58 |
+
axs[2].plot(t, y3, label=label_exp_decay, color="blue")
|
59 |
+
axs[2].set_xlim(*xlim_values)
|
60 |
+
axs[2].set_ylim(*ylim_values_exp)
|
61 |
+
axs[2].set_title(title_exp, y=1.1)
|
62 |
+
axs[2].set_xlabel(xlabel_value)
|
63 |
+
axs[2].set_ylabel(ylabel_value_exp_log)
|
64 |
+
|
65 |
+
axs[3].plot(t, y4, label=label_log_growth, color="red")
|
66 |
+
axs[3].set_xlim(*xlim_values)
|
67 |
+
axs[3].set_ylim(*ylim_values_log)
|
68 |
+
axs[3].set_title(title_log, y=1.1)
|
69 |
+
axs[3].set_xlabel(xlabel_value)
|
70 |
+
axs[3].set_ylabel(ylabel_value_exp_log)
|
71 |
+
|
72 |
+
for ax in axs.flat:
|
73 |
+
ax.legend(loc="upper center", bbox_to_anchor=(0.5, 1.15), frameon=False)
|
74 |
+
|
75 |
+
# ===================
|
76 |
+
# Part 4: Saving Output
|
77 |
+
# ===================
|
78 |
+
plt.tight_layout()
|
79 |
+
plt.savefig('line_51.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_52.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_52.py
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
x1 = np.array([0.7, 0.75, 0.8, 0.85, 0.9])
|
13 |
+
y1 = np.array([76, 78, 80, 79, 77])
|
14 |
+
e1 = np.array([3, 2, 4, 3, 3])
|
15 |
+
|
16 |
+
x2 = np.array([0.1, 0.2, 0.3, 0.4])
|
17 |
+
y2 = np.array([74, 78, 76, 72])
|
18 |
+
e2 = np.array([4, 2, 2, 2])
|
19 |
+
|
20 |
+
x3 = np.array([0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
|
21 |
+
y3 = np.array([75, 78, 70, 65, 60, 55])
|
22 |
+
e3 = np.array([3, 2, 5, 4, 6, 5])
|
23 |
+
|
24 |
+
x4 = np.array([400, 600, 800, 1000, 1200])
|
25 |
+
y4 = np.array([80, 82, 77, 75, 72])
|
26 |
+
e4 = np.array([2, 3, 4, 3, 2])
|
27 |
+
|
28 |
+
# Titles
|
29 |
+
titles = [
|
30 |
+
"(a) Positive bound",
|
31 |
+
"(b) Negative bound",
|
32 |
+
"(d) Contrastive loss weight",
|
33 |
+
"(c) Fuzzy coefficient",
|
34 |
+
]
|
35 |
+
|
36 |
+
# ===================
|
37 |
+
# Part 3: Plot Configuration and Rendering
|
38 |
+
# ===================
|
39 |
+
# Create 2x2 subplots
|
40 |
+
fig, axs = plt.subplots(2, 2, figsize=(9, 6))
|
41 |
+
|
42 |
+
# Flatten the axis array for easy iteration
|
43 |
+
axs = axs.flatten()
|
44 |
+
|
45 |
+
# Setting data for each subplot
|
46 |
+
data = [(x1, y1, e1), (x2, y2, e2), (x3, y3, e3), (x4, y4, e4)]
|
47 |
+
|
48 |
+
# Plot with error bars in each subplot
|
49 |
+
for ax, (x, y, e), title in zip(axs, data, titles):
|
50 |
+
ax.errorbar(
|
51 |
+
x, y, yerr=e, fmt="-o", color="blue", ecolor="red", capsize=5, markersize=6
|
52 |
+
)
|
53 |
+
ax.set_title(title, fontsize=16)
|
54 |
+
ax.grid(True, alpha=0.5)
|
55 |
+
ax.set_xticks(x)
|
56 |
+
ax.set_yticks(np.linspace(min(y) - min(e), max(y) + max(e), num=5, endpoint=True))
|
57 |
+
|
58 |
+
# ===================
|
59 |
+
# Part 4: Saving Output
|
60 |
+
# ===================
|
61 |
+
# Adjust layout and save the figure
|
62 |
+
plt.tight_layout()
|
63 |
+
plt.savefig('line_52.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_53.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_53.py
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Enhanced sample data to accommodate more subplots
|
12 |
+
x1 = np.array([0.7, 0.75, 0.8, 0.85, 0.9])
|
13 |
+
y1 = np.random.uniform(75, 85, size=len(x1))
|
14 |
+
e1 = np.random.uniform(1, 4, size=len(x1))
|
15 |
+
|
16 |
+
x2 = np.array([0.1, 0.2, 0.3, 0.4])
|
17 |
+
y2 = np.random.uniform(70, 80, size=len(x2))
|
18 |
+
e2 = np.random.uniform(1, 4, size=len(x2))
|
19 |
+
|
20 |
+
x3 = np.array([0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
|
21 |
+
y3 = np.random.uniform(50, 80, size=len(x3))
|
22 |
+
e3 = np.random.uniform(1, 6, size=len(x3))
|
23 |
+
|
24 |
+
x4 = np.array([400, 600, 800, 1000, 1200])
|
25 |
+
y4 = np.random.uniform(65, 85, size=len(x4))
|
26 |
+
e4 = np.random.uniform(1, 4, size=len(x4))
|
27 |
+
|
28 |
+
x5 = np.array([0.5, 0.6, 0.7, 0.8, 0.9])
|
29 |
+
y5 = np.random.uniform(50, 80, size=len(x5))
|
30 |
+
e5 = np.random.uniform(1, 4, size=len(x5))
|
31 |
+
|
32 |
+
x6 = np.array([300, 500, 700, 900, 1100])
|
33 |
+
y6 = np.random.uniform(65, 85, size=len(x6))
|
34 |
+
e6 = np.random.uniform(1, 4, size=len(x6))
|
35 |
+
|
36 |
+
# Titles
|
37 |
+
titles = [
|
38 |
+
"Positive Bound",
|
39 |
+
"Negative Bound",
|
40 |
+
"Contrastive Loss Weight",
|
41 |
+
"Fuzzy Coefficient",
|
42 |
+
"Additional Metric 1",
|
43 |
+
"Additional Metric 2",
|
44 |
+
]
|
45 |
+
|
46 |
+
# ===================
|
47 |
+
# Part 3: Plot Configuration and Rendering
|
48 |
+
# ===================
|
49 |
+
# Create 2x3 subplots for a unified visual presentation
|
50 |
+
fig, axs = plt.subplots(2, 3, figsize=(12, 8))
|
51 |
+
|
52 |
+
colors = ["red", "green", "blue", "purple", "magenta", "cyan"]
|
53 |
+
|
54 |
+
data_pairs = [
|
55 |
+
(x1, y1, e1),
|
56 |
+
(x2, y2, e2),
|
57 |
+
(x3, y3, e3),
|
58 |
+
(x4, y4, e4),
|
59 |
+
(x5, y5, e5),
|
60 |
+
(x6, y6, e6),
|
61 |
+
]
|
62 |
+
|
63 |
+
for ax, (x, y, e), title, color in zip(axs.flat, data_pairs, titles, colors):
|
64 |
+
ax.errorbar(
|
65 |
+
x, y, yerr=e, fmt="-o", color=color, ecolor="lightgray", capsize=5, label=title
|
66 |
+
)
|
67 |
+
ax.set_title(title)
|
68 |
+
ax.set_xticks(x)
|
69 |
+
ax.set_ylim(min(y) - min(e) - 0.1, max(y) + max(e) + 0.1)
|
70 |
+
ax.legend(loc="upper left")
|
71 |
+
|
72 |
+
# ===================
|
73 |
+
# Part 4: Saving Output
|
74 |
+
# ===================
|
75 |
+
# Adjust layout to ensure no overlap and labels are clearly visible
|
76 |
+
plt.tight_layout()
|
77 |
+
plt.savefig('line_53.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_54.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_54.py
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ===================
|
2 |
+
# Part 1: Importing Libraries
|
3 |
+
# ===================
|
4 |
+
import matplotlib.pyplot as plt
|
5 |
+
|
6 |
+
# ===================
|
7 |
+
# Part 2: Data Preparation
|
8 |
+
# ===================
|
9 |
+
# Data
|
10 |
+
driving_styles = ["Passive", "Rail", "Replay", "Sportive"]
|
11 |
+
relaxation_dry = [1.4, 0.9, 0.8, 0.5]
|
12 |
+
relaxation_rain = [1.3, 1.1, 1.0, 0.3]
|
13 |
+
relaxation_snow = [0.7, 0.6, 0.5, 0.2] # Additional data for snow condition
|
14 |
+
relaxation_fog = [1.0, 0.8, 0.7, 0.4] # Additional data for fog condition
|
15 |
+
error = [0.05, 0.05, 0.05, 0.05]
|
16 |
+
|
17 |
+
# Axes Limits and Labels
|
18 |
+
xlabel_value = "Driving Style"
|
19 |
+
|
20 |
+
ylabel_value = "Relaxation Level"
|
21 |
+
ylim_values = [0, 1.5]
|
22 |
+
|
23 |
+
# Titles
|
24 |
+
titles = ["Dry vs Rain", "Snow vs Fog", "Rain vs Snow"]
|
25 |
+
|
26 |
+
# ===================
|
27 |
+
# Part 3: Plot Configuration and Rendering
|
28 |
+
# ===================
|
29 |
+
# Create a 1x3 subplot layout
|
30 |
+
fig, axs = plt.subplots(1, 3, figsize=(12, 4))
|
31 |
+
|
32 |
+
# Titles and setup for subplots
|
33 |
+
data_pairs = [
|
34 |
+
(relaxation_dry, relaxation_rain),
|
35 |
+
(relaxation_snow, relaxation_fog),
|
36 |
+
(relaxation_rain, relaxation_snow),
|
37 |
+
]
|
38 |
+
colors_pairs = [("black", "red"), ("blue", "green"), ("red", "blue")]
|
39 |
+
|
40 |
+
# Plot each condition in a separate subplot
|
41 |
+
for ax, title, (data1, data2), (color1, color2) in zip(
|
42 |
+
axs, titles, data_pairs, colors_pairs
|
43 |
+
):
|
44 |
+
ax.errorbar(
|
45 |
+
driving_styles,
|
46 |
+
data1,
|
47 |
+
yerr=error,
|
48 |
+
fmt="o-",
|
49 |
+
color=color1,
|
50 |
+
ecolor=color1,
|
51 |
+
elinewidth=2,
|
52 |
+
capsize=5,
|
53 |
+
capthick=2,
|
54 |
+
label=f'{title.split(" vs ")[0]}',
|
55 |
+
)
|
56 |
+
ax.errorbar(
|
57 |
+
driving_styles,
|
58 |
+
data2,
|
59 |
+
yerr=error,
|
60 |
+
fmt="s-",
|
61 |
+
color=color2,
|
62 |
+
ecolor=color2,
|
63 |
+
elinewidth=2,
|
64 |
+
capsize=5,
|
65 |
+
capthick=2,
|
66 |
+
label=f'{title.split(" vs ")[1]}',
|
67 |
+
)
|
68 |
+
ax.set_xlabel(xlabel_value)
|
69 |
+
ax.set_ylabel(ylabel_value)
|
70 |
+
ax.tick_params(
|
71 |
+
axis="both", which="major", length=5, direction="in", top=True, right=True
|
72 |
+
)
|
73 |
+
ax.legend(loc="upper right", frameon=True)
|
74 |
+
ax.set_ylim(ylim_values)
|
75 |
+
ax.grid(True, which="major", linestyle="--", linewidth=0.5, alpha=0.5)
|
76 |
+
ax.set_title(title)
|
77 |
+
|
78 |
+
# ===================
|
79 |
+
# Part 4: Saving Output
|
80 |
+
# ===================
|
81 |
+
# Adjust layout and save the figure
|
82 |
+
plt.tight_layout()
|
83 |
+
plt.savefig('line_54.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_55.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_55.py
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Updated data
|
12 |
+
n_aug = ["0", "0.125", "0.25", "0.5", "1", "2", "4", "8"]
|
13 |
+
content = np.array([2, 4, 6, 8, 6, 5, 3, 1]) # 更加动态的变化
|
14 |
+
organization = np.array([1, 2, 3, 4, 3.5, 2.5, 1.5, 0.7]) # 平滑的递增后递减
|
15 |
+
language = np.array([0.5, 1.5, 2.5, 3.5, 4.5, 3.5, 2.5, 1.5]) # 高峰在中间
|
16 |
+
|
17 |
+
# Axes Limits and Labels
|
18 |
+
xlabel_value = "n$_{aug}$"
|
19 |
+
xlim_values = [0, len(n_aug) - 1]
|
20 |
+
|
21 |
+
ylabel_value = "Performance Gain (%)"
|
22 |
+
ylim_values = [0, max(content) + 1]
|
23 |
+
|
24 |
+
# Labels
|
25 |
+
label_Content="Content"
|
26 |
+
label_Organization="Organization"
|
27 |
+
label_Language="Language"
|
28 |
+
|
29 |
+
# Titles
|
30 |
+
title = "Dynamic Performance Gain Across Different n$_{aug}$ Levels"
|
31 |
+
|
32 |
+
# ===================
|
33 |
+
# Part 3: Plot Configuration and Rendering
|
34 |
+
# ===================
|
35 |
+
# Plot
|
36 |
+
fig, ax = plt.subplots(figsize=(8, 3))
|
37 |
+
ax.plot(
|
38 |
+
n_aug, content, "o-", label=label_Content, color="royalblue", linewidth=2, markersize=8
|
39 |
+
)
|
40 |
+
ax.plot(
|
41 |
+
n_aug,
|
42 |
+
organization,
|
43 |
+
"s--",
|
44 |
+
label=label_Organization,
|
45 |
+
color="crimson",
|
46 |
+
linewidth=2,
|
47 |
+
markersize=8,
|
48 |
+
)
|
49 |
+
ax.plot(
|
50 |
+
n_aug,
|
51 |
+
language,
|
52 |
+
"^:",
|
53 |
+
label=label_Language,
|
54 |
+
color="limegreen",
|
55 |
+
linewidth=2,
|
56 |
+
markersize=8,
|
57 |
+
)
|
58 |
+
|
59 |
+
# Enhancements for visual appeal
|
60 |
+
ax.set_facecolor("#e6f0ff") # Light blue background
|
61 |
+
ax.spines["top"].set_color("none")
|
62 |
+
ax.spines["right"].set_color("none")
|
63 |
+
ax.spines["left"].set_color("gray")
|
64 |
+
ax.spines["bottom"].set_color("gray")
|
65 |
+
|
66 |
+
# Setting axis limits and ticks dynamically based on data
|
67 |
+
ax.set_ylim(ylim_values)
|
68 |
+
ax.set_xlim(xlim_values)
|
69 |
+
|
70 |
+
# Customizing labels and grid
|
71 |
+
ax.set_xlabel(xlabel_value, fontsize=14)
|
72 |
+
ax.set_ylabel(ylabel_value, fontsize=14)
|
73 |
+
ax.set_title(title, fontsize=16)
|
74 |
+
|
75 |
+
# Custom legend
|
76 |
+
ax.legend(loc="upper right", fontsize=12, frameon=True, shadow=True)
|
77 |
+
|
78 |
+
# Grid
|
79 |
+
ax.grid(True, linestyle="--", alpha=0.5, color="grey")
|
80 |
+
|
81 |
+
# ===================
|
82 |
+
# Part 4: Saving Output
|
83 |
+
# ===================
|
84 |
+
# Tight layout for better spacing
|
85 |
+
plt.tight_layout()
|
86 |
+
plt.savefig('line_55.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_56.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_56.py
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Define a custom color palette
|
12 |
+
colors = ["#e74c3c", "#3498db", "#2ecc71", "#f39c12", "#9b59b6"]
|
13 |
+
|
14 |
+
# Data setup
|
15 |
+
decomposition_IO_norm = np.array([0, 20, 40, 60, 80])
|
16 |
+
coco_10k = np.array([0.60, 0.70, 0.72, 0.73, 0.74])
|
17 |
+
laion_10k = np.array([0.58, 0.67, 0.70, 0.71, 0.73])
|
18 |
+
coco_5k = np.array([0.56, 0.66, 0.67, 0.68, 0.70])
|
19 |
+
laion_5k = np.array([0.55, 0.61, 0.64, 0.65, 0.68])
|
20 |
+
|
21 |
+
# Axes Limits and Labels
|
22 |
+
xlabel_value = "Decomposition IO Norm"
|
23 |
+
xlim_values = [-5, 85]
|
24 |
+
ylabel_value = "Accuracy"
|
25 |
+
ylim_values = [0.53, 0.76]
|
26 |
+
|
27 |
+
# Labels
|
28 |
+
label_1 = "COCO (10k)"
|
29 |
+
label_2 = "LAION (10k)"
|
30 |
+
label_3 = "COCO (5k)"
|
31 |
+
label_4="LAION (5k)"
|
32 |
+
|
33 |
+
# Titles
|
34 |
+
title_1 = "COCO 10K"
|
35 |
+
title_2 = "LAION 10K"
|
36 |
+
title_3 = "COCO & LAION 5K"
|
37 |
+
|
38 |
+
# ===================
|
39 |
+
# Part 3: Plot Configuration and Rendering
|
40 |
+
# ===================
|
41 |
+
# Create the 1x3 subplot configuration
|
42 |
+
fig, axs = plt.subplots(1, 3, figsize=(9, 3))
|
43 |
+
|
44 |
+
# Plot customization for a fancy look
|
45 |
+
marker_styles = ["o", "^", "s", "x"]
|
46 |
+
line_styles = ["-", "--", ":", "-."]
|
47 |
+
|
48 |
+
# First subplot for coco 10k
|
49 |
+
axs[0].plot(
|
50 |
+
decomposition_IO_norm,
|
51 |
+
coco_10k,
|
52 |
+
label=label_1,
|
53 |
+
color=colors[0],
|
54 |
+
marker=marker_styles[0],
|
55 |
+
linestyle=line_styles[0],
|
56 |
+
markersize=10,
|
57 |
+
linewidth=2,
|
58 |
+
)
|
59 |
+
axs[0].set_title(title_1, fontsize=14)
|
60 |
+
axs[0].set_xlabel(xlabel_value, fontsize=12)
|
61 |
+
axs[0].set_ylabel(ylabel_value, fontsize=12)
|
62 |
+
|
63 |
+
# Second subplot for laion 10k
|
64 |
+
axs[1].plot(
|
65 |
+
decomposition_IO_norm,
|
66 |
+
laion_10k,
|
67 |
+
label=label_2,
|
68 |
+
color=colors[1],
|
69 |
+
marker=marker_styles[1],
|
70 |
+
linestyle=line_styles[1],
|
71 |
+
markersize=10,
|
72 |
+
linewidth=2,
|
73 |
+
)
|
74 |
+
axs[1].set_title(title_2, fontsize=14)
|
75 |
+
axs[1].set_xlabel(xlabel_value, fontsize=12)
|
76 |
+
axs[1].set_ylabel(ylabel_value, fontsize=12)
|
77 |
+
|
78 |
+
# Third subplot for coco & laion 5k
|
79 |
+
axs[2].plot(
|
80 |
+
decomposition_IO_norm,
|
81 |
+
coco_5k,
|
82 |
+
label=label_3,
|
83 |
+
color=colors[2],
|
84 |
+
marker=marker_styles[2],
|
85 |
+
linestyle=line_styles[2],
|
86 |
+
markersize=10,
|
87 |
+
linewidth=2,
|
88 |
+
)
|
89 |
+
axs[2].plot(
|
90 |
+
decomposition_IO_norm,
|
91 |
+
laion_5k,
|
92 |
+
label=label_4,
|
93 |
+
color=colors[3],
|
94 |
+
marker=marker_styles[3],
|
95 |
+
linestyle=line_styles[3],
|
96 |
+
markersize=10,
|
97 |
+
linewidth=2,
|
98 |
+
)
|
99 |
+
axs[2].set_title(title_3, fontsize=14)
|
100 |
+
axs[2].set_xlabel(xlabel_value, fontsize=12)
|
101 |
+
axs[2].set_ylabel(ylabel_value, fontsize=12)
|
102 |
+
|
103 |
+
# Set global properties and customize each subplot individually
|
104 |
+
for ax in axs:
|
105 |
+
ax.set_xticks(decomposition_IO_norm)
|
106 |
+
ax.set_xlim(xlim_values)
|
107 |
+
ax.set_ylim(ylim_values)
|
108 |
+
ax.legend(loc="lower right", fontsize=10)
|
109 |
+
|
110 |
+
# ===================
|
111 |
+
# Part 4: Saving Output
|
112 |
+
# ===================
|
113 |
+
# Adjust layout to ensure no overlap and labels are clearly visible
|
114 |
+
plt.tight_layout()
|
115 |
+
|
116 |
+
# Show the plot
|
117 |
+
plt.savefig('line_56.pdf', bbox_inches='tight')
|
ChartMimic/dataset/ori_500/line_57.png
ADDED
![]() |
ChartMimic/dataset/ori_500/line_57.py
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
# Simulated data based on the previous setup
|
12 |
+
learning_rate = [0.01, 0.05, 0.1, 0.2]
|
13 |
+
error_rate_64 = np.array([0.18, 0.15, 0.12, 0.10])
|
14 |
+
error_rate_128 = np.array([0.16, 0.13, 0.11, 0.09])
|
15 |
+
error_rate_256 = np.array([0.14, 0.11, 0.08, 0.07])
|
16 |
+
dropout_rate = [0.0, 0.1, 0.2, 0.3]
|
17 |
+
accuracy_64 = np.array([0.82, 0.85, 0.83, 0.80])
|
18 |
+
accuracy_128 = np.array([0.84, 0.87, 0.86, 0.83])
|
19 |
+
|
20 |
+
# Axes Limits and Labels
|
21 |
+
xlabel_value = "Parameter Rate"
|
22 |
+
|
23 |
+
ylabel_value = "Metric"
|
24 |
+
|
25 |
+
# Labels
|
26 |
+
label_1 = " (Batch Size=64)"
|
27 |
+
label_2 = " (Batch Size=128)"
|
28 |
+
label_3 = "Error Rate vs. Learning Rate"
|
29 |
+
label_4 = "Accuracy vs. Dropout"
|
30 |
+
|
31 |
+
# ===================
|
32 |
+
# Part 3: Plot Configuration and Rendering
|
33 |
+
# ===================
|
34 |
+
# Create a figure with a 3x2 grid
|
35 |
+
fig, axs = plt.subplots(3, 2, figsize=(12, 9))
|
36 |
+
|
37 |
+
# Custom colors for the plots
|
38 |
+
colors = ["dodgerblue", "tomato", "limegreen", "gold", "purple"]
|
39 |
+
|
40 |
+
|
41 |
+
# Function to plot the data
|
42 |
+
def plot_data(ax, x, y1, y2, title, marker1, marker2, color1, color2):
|
43 |
+
ax.plot(
|
44 |
+
x,
|
45 |
+
y1,
|
46 |
+
marker=marker1,
|
47 |
+
markersize=8,
|
48 |
+
linewidth=2,
|
49 |
+
color=color1,
|
50 |
+
label=f"{title}{label_1}",
|
51 |
+
)
|
52 |
+
ax.plot(
|
53 |
+
x,
|
54 |
+
y2,
|
55 |
+
marker=marker2,
|
56 |
+
markersize=8,
|
57 |
+
linewidth=2,
|
58 |
+
color=color2,
|
59 |
+
label=f"{title}{label_2}",
|
60 |
+
)
|
61 |
+
ax.set_title(title, fontsize=14)
|
62 |
+
ax.set_xlabel(xlabel_value, fontsize=12)
|
63 |
+
ax.set_ylabel(ylabel_value, fontsize=12)
|
64 |
+
ax.legend(loc="best", fontsize=10, frameon=True, shadow=True)
|
65 |
+
ax.grid(True, linestyle="--", alpha=0.5)
|
66 |
+
|
67 |
+
|
68 |
+
# Assigning data to each subplot
|
69 |
+
plot_data(
|
70 |
+
axs[0, 0],
|
71 |
+
learning_rate,
|
72 |
+
error_rate_64,
|
73 |
+
error_rate_128,
|
74 |
+
label_3,
|
75 |
+
"o",
|
76 |
+
"s",
|
77 |
+
colors[0],
|
78 |
+
colors[1],
|
79 |
+
)
|
80 |
+
plot_data(
|
81 |
+
axs[0, 1],
|
82 |
+
dropout_rate,
|
83 |
+
accuracy_64,
|
84 |
+
accuracy_128,
|
85 |
+
label_4,
|
86 |
+
"^",
|
87 |
+
"d",
|
88 |
+
colors[2],
|
89 |
+
colors[3],
|
90 |
+
)
|
91 |
+
plot_data(
|
92 |
+
axs[1, 0],
|
93 |
+
learning_rate,
|
94 |
+
error_rate_128,
|
95 |
+
error_rate_256,
|
96 |
+
label_3,
|
97 |
+
">",
|
98 |
+
"<",
|
99 |
+
colors[4],
|
100 |
+
colors[0],
|
101 |
+
)
|
102 |
+
plot_data(
|
103 |
+
axs[1, 1],
|
104 |
+
dropout_rate,
|
105 |
+
accuracy_128,
|
106 |
+
accuracy_64,
|
107 |
+
label_4,
|
108 |
+
"p",
|
109 |
+
"*",
|
110 |
+
colors[1],
|
111 |
+
colors[2],
|
112 |
+
)
|
113 |
+
plot_data(
|
114 |
+
axs[2, 0],
|
115 |
+
learning_rate,
|
116 |
+
error_rate_256,
|
117 |
+
error_rate_64,
|
118 |
+
label_3,
|
119 |
+
"H",
|
120 |
+
"X",
|
121 |
+
colors[3],
|
122 |
+
colors[4],
|
123 |
+
)
|
124 |
+
plot_data(
|
125 |
+
axs[2, 1],
|
126 |
+
dropout_rate,
|
127 |
+
accuracy_64,
|
128 |
+
accuracy_128,
|
129 |
+
label_4,
|
130 |
+
"+",
|
131 |
+
"x",
|
132 |
+
colors[0],
|
133 |
+
colors[1],
|
134 |
+
)
|
135 |
+
|
136 |
+
# ===================
|
137 |
+
# Part 4: Saving Output
|
138 |
+
# ===================
|
139 |
+
# Adjust layout and display the plots
|
140 |
+
plt.tight_layout()
|
141 |
+
plt.savefig('line_57.pdf', bbox_inches='tight')
|