diff --git a/eval/distribution_comparison_boxplots.py b/eval/distribution_comparison_boxplots.py index 573e8e7..19612de 100644 --- a/eval/distribution_comparison_boxplots.py +++ b/eval/distribution_comparison_boxplots.py @@ -19,7 +19,7 @@ import data_cache # Increase all font sizes by 16 points from their defaults -rcParams.update({key: rcParams[key] + 16 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +rcParams.update({key: rcParams[key] + 32 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # ============================================================================ # CONFIGURATION SECTION @@ -249,26 +249,25 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o print(f"Found {len(block_runs)} block runs and {len(zns_runs)} ZNS runs") - # Create figure with 6 subplots (1 row x 6 columns) using GridSpec for custom widths + # Create figure with 6 subplots (2 rows x 3 columns) using GridSpec for custom widths # Subplots are 2/5 original height, but all spacing preserved - num_subplots = len(RATIOS) * len(CHUNK_SIZES) # 2 ratios * 3 chunk sizes = 6 + num_ratios = len(RATIOS) + num_chunk_sizes = len(CHUNK_SIZES) - # Width ratios: 1077MiB subplots (indices 2 and 5) are half as wide since they have 2 boxes instead of 4 - width_ratios = [1, 1, 0.5, 1, 1, 0.5] + # Width ratios: 1077MiB subplots (column 2) are half as wide since they have 2 boxes instead of 4 + width_ratios = [1, 1, 0.5] - fig = plt.figure(figsize=(5 * num_subplots, 5.38)) - gs = GridSpec(1, num_subplots, figure=fig, width_ratios=width_ratios) - axes = [fig.add_subplot(gs[0, i]) for i in range(num_subplots)] + fig = plt.figure(figsize=(8.0 * num_chunk_sizes, 7.0 * num_ratios)) + gs = GridSpec(num_ratios, num_chunk_sizes, figure=fig, width_ratios=width_ratios) + axes = [[fig.add_subplot(gs[i, j]) for j in range(num_chunk_sizes)] for i in range(num_ratios)] # First pass: collect all data to find global maximum for y-axis all_subplot_data = [] global_max = 0.0 - idx = 0 - # Iterate through ratios, then chunk sizes - for ratio in RATIOS: - for chunk_size in CHUNK_SIZES: + for ratio_idx, ratio in enumerate(RATIOS): + for chunk_idx, chunk_size in enumerate(CHUNK_SIZES): # Prepare data for this subplot current_data = [] labels = [] @@ -364,7 +363,9 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o 'labels': labels, 'colors': colors, 'hatches': hatches, - 'chunk_size': chunk_size + 'chunk_size': chunk_size, + 'ratio_idx': ratio_idx, + 'chunk_idx': chunk_idx }) # Update global maximum if using common scale @@ -375,8 +376,6 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o if local_max > global_max: global_max = local_max - idx += 1 - # Add some padding to the global max (10% above highest value) if common_y_scale: y_max = global_max * 1.1 @@ -385,13 +384,14 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o y_max = None # Second pass: create boxplots with common y-axis - idx = 0 for subplot_info in all_subplot_data: current_data = subplot_info['data'] labels = subplot_info['labels'] colors = subplot_info['colors'] hatches = subplot_info['hatches'] chunk_size = subplot_info['chunk_size'] + ratio_idx = subplot_info['ratio_idx'] + chunk_idx = subplot_info['chunk_idx'] # Create boxplot for this subplot if current_data: @@ -404,10 +404,13 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o else: box_width = 0.8 * (num_boxes / 4) if num_boxes > 0 else 0.8 - bp = axes[idx].boxplot(current_data, + bp = axes[ratio_idx][chunk_idx].boxplot(current_data, showfliers=show_outliers, widths=box_width, - medianprops=dict(linewidth=2, color='black'), + boxprops=dict(linewidth=3), + whiskerprops=dict(linewidth=3), + capprops=dict(linewidth=3), + medianprops=dict(linewidth=3, color='black'), patch_artist=True) # Apply colors and hatches @@ -418,46 +421,45 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o box.set_alpha(0.7) # Set x-axis labels (empty for cleaner look, or could add device labels) - axes[idx].set_xticks(range(1, len(labels) + 1)) - axes[idx].set_xticklabels([], rotation=45, fontsize=10) + axes[ratio_idx][chunk_idx].set_xticks(range(1, len(labels) + 1)) + axes[ratio_idx][chunk_idx].set_xticklabels([], rotation=45, fontsize=10) # Add chunk size label below subplot - axes[idx].set_xlabel(CHUNK_SIZE_LABELS[chunk_size], fontsize=28, weight='bold') + axes[ratio_idx][chunk_idx].set_xlabel(CHUNK_SIZE_LABELS[chunk_size], fontsize=58, weight='bold') # Use scalar formatter without scientific notation - axes[idx].yaxis.set_major_formatter(ticker.ScalarFormatter(useOffset=False, useMathText=False)) + axes[ratio_idx][chunk_idx].yaxis.set_major_formatter(ticker.ScalarFormatter(useOffset=False, useMathText=False)) # Rotate y-axis labels - for label in axes[idx].get_yticklabels(): + for label in axes[ratio_idx][chunk_idx].get_yticklabels(): label.set_rotation(45) # Set y-axis range if common_y_scale: # Use common y-axis maximum for all subplots - axes[idx].set_ylim(0, y_max) + axes[ratio_idx][chunk_idx].set_ylim(0, y_max) else: # Just set bottom to 0, let matplotlib auto-scale the top - axes[idx].set_ylim(bottom=0) - - idx += 1 + axes[ratio_idx][chunk_idx].set_ylim(bottom=0) # Add y-axis label on the far left - fig.text(-0.005, 0.5, metric_label, va='center', rotation='vertical', fontsize=22, weight='bold') + fig.text(-0.065, 0.5, metric_label, va='center', rotation='vertical', fontsize=64, weight='bold') # Adjust layout (do these BEFORE computing positions) - subplots at 2/5 height with proportional spacing - plt.subplots_adjust(wspace=0.2, hspace=0.0) plt.tight_layout(pad=0.0) - plt.subplots_adjust(top=0.851, bottom=0.279, left=0.05) + plt.subplots_adjust(top=0.90, bottom=0.15, left=0.08, hspace=1.2, wspace=0.3) # Make sure layout is finalized fig.canvas.draw() # Compute positions for ratio boxes and labels based on actual subplot bounds - axes_bboxes = [ax.get_position().bounds for ax in axes] # (x, y, w, h) per axes + # Flatten the 2D axes array to get all subplot bounds + axes_flat = [axes[i][j] for i in range(num_ratios) for j in range(num_chunk_sizes)] + axes_bboxes = [ax.get_position().bounds for ax in axes_flat] # (x, y, w, h) per axes - # First 3 subplots -> Ratio 1:2, next 3 -> Ratio 1:10 - group1 = axes_bboxes[0:3] - group2 = axes_bboxes[3:6] + # First row (3 subplots) -> Ratio 1:2, second row (3 subplots) -> Ratio 1:10 + group1 = axes_bboxes[0:3] # First row + group2 = axes_bboxes[3:6] # Second row # Left/right bounds of each group g1_left = group1[0][0] @@ -468,14 +470,21 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o g2_right = group2[-1][0] + group2[-1][2] g2_width = g2_right - g2_left - # Vertical placement of the grey boxes in figure coords - box_y = 0.85 - box_h = 0.10 + # Vertical placement of the grey boxes - position above each row + # Get the top y position of each row's subplots and add some padding + g1_top = group1[0][1] + group1[0][3] # y + height of first row + g2_top = group2[0][1] + group2[0][3] # y + height of second row + + box_h = 0.06 + box_y_offset = 0.02 # Space above the subplot + + g1_box_y = g1_top + box_y_offset + g2_box_y = g2_top + box_y_offset - # Grey box for Ratio 1:2 + # Grey box for Ratio 1:2 (first row) fig.add_artist( Rectangle( - (g1_left, box_y), + (g1_left, g1_box_y), g1_width, box_h, transform=fig.transFigure, @@ -487,10 +496,10 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o ) ) - # Grey box for Ratio 1:10 + # Grey box for Ratio 1:10 (second row) fig.add_artist( Rectangle( - (g2_left, box_y), + (g2_left, g2_box_y), g2_width, box_h, transform=fig.transFigure, @@ -505,21 +514,21 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o # Centered text in each box fig.text( g1_left + g1_width / 2, - box_y + box_h / 2, + g1_box_y + box_h / 2, "Ratio: 1:2", ha='center', va='center', - fontsize=26, + fontsize=50, weight='bold', zorder=2, ) fig.text( g2_left + g2_width / 2, - box_y + box_h / 2, + g2_box_y + box_h / 2, "Ratio: 1:10", ha='center', va='center', - fontsize=26, + fontsize=50, weight='bold', zorder=2, ) @@ -533,9 +542,9 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, metric, o ] fig.legend( - ncols=4, + ncols=2, handles=legend_patches, - bbox_to_anchor=(0.5, 0.08), + bbox_to_anchor=(0.5, -0.08), loc='center', fontsize="large", columnspacing=2.0, diff --git a/eval/distribution_comparison_ecdfs.py b/eval/distribution_comparison_ecdfs.py index 8c63628..761603e 100644 --- a/eval/distribution_comparison_ecdfs.py +++ b/eval/distribution_comparison_ecdfs.py @@ -18,8 +18,8 @@ from datetime import datetime, timedelta import data_cache -# Increase all font sizes by 16 points from their defaults -rcParams.update({key: rcParams[key] + 16 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +# Increase all font sizes by 32 points from their defaults +rcParams.update({key: rcParams[key] + 32 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # ============================================================================ # CONFIGURATION SECTION @@ -328,22 +328,17 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, output_fi print(f"Found {len(block_runs)} block runs and {len(zns_runs)} ZNS runs") - # Create figure with 6 subplots (1 row x 6 columns) + # Create figure with 6 subplots (2 rows x 3 columns) # Subplots are 2/5 original height, but all spacing preserved - num_subplots = len(RATIOS) * len(CHUNK_SIZES) # 2 ratios * 3 chunk sizes = 6 - fig, axes = plt.subplots(1, num_subplots, figsize=(5 * num_subplots, 5.38)) - - # Ensure axes is always a list - if num_subplots == 1: - axes = [axes] - - idx = 0 + num_ratios = len(RATIOS) + num_chunk_sizes = len(CHUNK_SIZES) + fig, axes = plt.subplots(num_ratios, num_chunk_sizes, figsize=(5 * num_chunk_sizes, 5.38 * num_ratios)) # Iterate through ratios, then chunk sizes - for ratio in RATIOS: - for chunk_size in CHUNK_SIZES: + for ratio_idx, ratio in enumerate(RATIOS): + for chunk_idx, chunk_size in enumerate(CHUNK_SIZES): # Prepare data for this subplot - current_ax = axes[idx] + current_ax = axes[ratio_idx, chunk_idx] # Determine which eviction types to include if chunk_size == 1129316352: # 1076MiB only has promotional @@ -426,10 +421,10 @@ def generate_distribution_comparison(block_dir, zns_dir, distribution, output_fi print(f"Warning: No run found for {device} {eviction_type} chunk={chunk_size} dist={distribution} ratio={ratio}") # Configure subplot - current_ax.set_xlabel(CHUNK_SIZE_LABELS[chunk_size], fontsize=28, weight='bold') - if idx == 0: - ylabel = current_ax.set_ylabel('Cumulative Probability (%)', fontsize=25) - ylabel.set_position((-0.1, 0.3)) + current_ax.set_xlabel(CHUNK_SIZE_LABELS[chunk_size], fontsize=48, weight='bold') + if ratio_idx == 0 and chunk_idx == 0: + ylabel = current_ax.set_ylabel('Cumulative Probability (%)', fontsize=48) + ylabel.set_position((-0.15, -1.9)) current_ax.set_ylim(0, 100) # Configure x-axis scale @@ -462,24 +457,28 @@ def exp_formatter(x, pos): # Use MaxNLocator to ensure nice, evenly-spaced tick intervals current_ax.xaxis.set_major_locator(MaxNLocator(nbins=6, integer=False, prune=None)) + # Rotate x-axis tick labels + for label in current_ax.get_xticklabels(): + label.set_rotation(45) + label.set_ha('right') # Align right to prevent overlap + current_ax.grid(True, alpha=0.3, linestyle='--') # Rotate y-axis labels for label in current_ax.get_yticklabels(): label.set_rotation(45) - idx += 1 - # Adjust layout - subplots at 2/5 height with proportional spacing - plt.subplots_adjust(wspace=0.15, hspace=0.0) plt.tight_layout(pad=0.0) - plt.subplots_adjust(top=0.851, bottom=0.279, left=0.05) + plt.subplots_adjust(top=0.90, bottom=0.18, left=0.08, right=1.3, hspace=1.7, wspace=0.3) # Make sure layout is finalized fig.canvas.draw() # Compute positions for ratio boxes and labels based on actual subplot bounds - axes_bboxes = [ax.get_position().bounds for ax in axes] # (x, y, w, h) per axes + # Flatten the 2D axes array to get all subplot bounds + axes_flat = [axes[i][j] for i in range(num_ratios) for j in range(num_chunk_sizes)] + axes_bboxes = [ax.get_position().bounds for ax in axes_flat] # (x, y, w, h) per axes # Calculate the true center of all subplots leftmost = axes_bboxes[0][0] # x position of first subplot @@ -497,12 +496,12 @@ def exp_formatter(x, pos): Line2D([0], [0], color='#f781bf', linestyle='--', linewidth=LINE_WIDTH, label='Block (Chunk LRU)', alpha=0.8), ] - fig.legend(ncols=4, handles=legend_lines, bbox_to_anchor=(subplot_center, -0.09), + fig.legend(ncols=2, handles=legend_lines, bbox_to_anchor=(subplot_center, -0.25), loc='center', fontsize="large", columnspacing=2.0, frameon=False) # Add a background box for the x-axis label to make it stand out - label_y = 0.01 - label_width = 0.18 + label_y = -0.1 + label_width = 0.25 label_height = 0.08 fig.add_artist( Rectangle( @@ -521,7 +520,7 @@ def exp_formatter(x, pos): fig.text(subplot_center, label_y, 'Latency (ms)', ha='center', va='center', fontsize=30, weight='bold', zorder=11) - # First 3 subplots -> Ratio 1:2, next 3 -> Ratio 1:10 + # First 3 subplots -> Ratio 1:2 (first row), next 3 -> Ratio 1:10 (second row) group1 = axes_bboxes[0:3] group2 = axes_bboxes[3:6] @@ -534,14 +533,21 @@ def exp_formatter(x, pos): g2_right = group2[-1][0] + group2[-1][2] g2_width = g2_right - g2_left - # Vertical placement of the grey boxes in figure coords - box_y = 0.85 - box_h = 0.10 + # Vertical placement of the grey boxes - position above each row + # Get the top y position of each row's subplots and add some padding + g1_top = group1[0][1] + group1[0][3] # y + height of first row + g2_top = group2[0][1] + group2[0][3] # y + height of second row + + box_h = 0.06 + box_y_offset = 0.02 # Space above the subplot + + g1_box_y = g1_top + box_y_offset + g2_box_y = g2_top + box_y_offset - # Grey box for Ratio 1:2 + # Grey box for Ratio 1:2 (first row) fig.add_artist( Rectangle( - (g1_left, box_y), + (g1_left, g1_box_y), g1_width, box_h, transform=fig.transFigure, @@ -553,10 +559,10 @@ def exp_formatter(x, pos): ) ) - # Grey box for Ratio 1:10 + # Grey box for Ratio 1:10 (second row) fig.add_artist( Rectangle( - (g2_left, box_y), + (g2_left, g2_box_y), g2_width, box_h, transform=fig.transFigure, @@ -571,21 +577,21 @@ def exp_formatter(x, pos): # Centered text in each box fig.text( g1_left + g1_width / 2, - box_y + box_h / 2, + g1_box_y + box_h / 2, "Ratio: 1:2", ha='center', va='center', - fontsize=26, + fontsize=50, weight='bold', zorder=2, ) fig.text( g2_left + g2_width / 2, - box_y + box_h / 2, + g2_box_y + box_h / 2, "Ratio: 1:10", ha='center', va='center', - fontsize=26, + fontsize=50, weight='bold', zorder=2, ) diff --git a/eval/ecdf_wt.py b/eval/ecdf_wt.py index 65e196f..57b02a7 100755 --- a/eval/ecdf_wt.py +++ b/eval/ecdf_wt.py @@ -404,6 +404,8 @@ def generate_ecdf(block_dir, zns_dir, output_file, metric_type="get_total", samp # Configure subplot # ax.set_xlabel("64KiB", fontsize=28, weight='bold') ax.set_ylabel('Cumulative Probability (%)', fontsize=25) + # Manually position the y-axis label lower + ax.yaxis.set_label_coords(-0.3, 0.3) ax.set_ylim(0, 100) # Configure x-axis scale @@ -464,7 +466,7 @@ def exp_formatter(x, pos): Line2D([0], [0], color='#f781bf', linestyle='--', linewidth=LINE_WIDTH, label='Block (Chunk LRU)', alpha=0.8), ] - fig.legend(ncols=4, handles=legend_lines, bbox_to_anchor=(subplot_center, -0.09), + fig.legend(ncols=2, handles=legend_lines, bbox_to_anchor=(subplot_center, -0.15), loc='center', fontsize="large", columnspacing=2.0, frameon=False) # Add a background box for the x-axis label to make it stand out diff --git a/eval/hitratio_horizontal_bars_combined.py b/eval/hitratio_horizontal_bars_combined.py index d397432..66a1cfa 100644 --- a/eval/hitratio_horizontal_bars_combined.py +++ b/eval/hitratio_horizontal_bars_combined.py @@ -381,7 +381,7 @@ def create_combined_horizontal_bar_chart(data_by_distribution, output_file): # Configure Y-axis ax.set_yticks(y_ticks) - ax.set_yticklabels(y_labels, fontsize=11) + ax.set_yticklabels(y_labels, fontsize=15, rotation=45) # Configure X-axis - use fewer ticks to avoid overlap ax.set_xlabel("Hit Ratio (%)", fontsize=13) @@ -414,7 +414,7 @@ def create_combined_horizontal_bar_chart(data_by_distribution, output_file): # Adjust layout with more space at bottom for legend and left for ratio boxes plt.tight_layout() - plt.subplots_adjust(bottom=0.18, wspace=0.45, left=0.22) + plt.subplots_adjust(bottom=0.18, wspace=0.45, left=0.22, right=0.99) # Make sure layout is finalized before getting positions fig.canvas.draw() @@ -506,9 +506,9 @@ def create_combined_horizontal_bar_chart(data_by_distribution, output_file): ) # Add legend at bottom center (below both subplots) - fig.legend(handles=legend_handles, loc='lower center', fontsize=10, - ncol=4, frameon=True, fancybox=True, shadow=True, - bbox_to_anchor=(0.5, 0.01), columnspacing=1.0) + fig.legend(handles=legend_handles, loc='lower center', fontsize=14, + ncol=2, frameon=True, fancybox=True, shadow=True, + bbox_to_anchor=(0.5, -0.08), columnspacing=1.0) plt.savefig(output_file, dpi=300, bbox_inches='tight') print(f"Saved: {output_file}") diff --git a/eval/plot_hitratio.py b/eval/plot_hitratio.py index ba52a76..657c871 100644 --- a/eval/plot_hitratio.py +++ b/eval/plot_hitratio.py @@ -12,8 +12,8 @@ import matplotlib.dates as mdates from matplotlib import rcParams -# Increase all font sizes by 4 points -rcParams.update({key: rcParams[key] + 4 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +# Increase all font sizes by 12 points +rcParams.update({key: rcParams[key] + 12 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # Device colors DEVICE_COLORS = { @@ -193,19 +193,20 @@ def plot_hitratio_group(normalized_name, dir_label_pairs, output_dir): time_minutes = [(t - start_time).total_seconds() / 60 for t in filtered_timestamps] color = get_color_for_label(label) - plt.plot(time_minutes, filtered_values, alpha=0.8, linewidth=1.2, label=label, color=color) + plt.plot(time_minutes, filtered_values, alpha=0.8, linewidth=1.5, label=label, color=color) has_data = True if has_data: plt.xlabel('Time (minutes)') plt.ylabel('Hit Ratio (%)') - plt.grid(True, alpha=0.3) plt.ylim(0, 100) # Hit ratio should be between 0 and 100% if len(dir_label_pairs) > 1: plt.legend() plt.tight_layout() + ax = plt.gca() + ax.grid(True, linewidth=1.0, alpha=0.5) # Save plot output_file = output_dir / f"{normalized_name}_hitratio.png" diff --git a/eval/plot_latency.py b/eval/plot_latency.py index 3c3b20a..f50bfed 100644 --- a/eval/plot_latency.py +++ b/eval/plot_latency.py @@ -14,8 +14,8 @@ import numpy as np import data_cache -# Increase all font sizes by 4 points -rcParams.update({key: rcParams[key] + 4 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +# Increase all font sizes by 12 points +rcParams.update({key: rcParams[key] + 12 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # Device colors DEVICE_COLORS = { @@ -306,7 +306,6 @@ def plot_latency_group(normalized_name, dir_label_pairs, metric_name, output_dir if has_data: plt.xlabel('Time (minutes)') plt.ylabel(f'Latency (ms)') - plt.grid(True, alpha=0.3) # Apply chunk-level y-axis limits plt.ylim(y_min, y_max) @@ -315,6 +314,8 @@ def plot_latency_group(normalized_name, dir_label_pairs, metric_name, output_dir plt.legend() plt.tight_layout() + ax = plt.gca() + ax.grid(True, linewidth=1.0, alpha=0.5) output_file = output_dir / f"{normalized_name}_{metric_name}_raw.png" plt.savefig(output_file, dpi=300, bbox_inches='tight', pad_inches=0) diff --git a/eval/plot_latency_smoothed.py b/eval/plot_latency_smoothed.py index de0f613..82fecb1 100644 --- a/eval/plot_latency_smoothed.py +++ b/eval/plot_latency_smoothed.py @@ -15,8 +15,8 @@ import numpy as np import data_cache -# Increase all font sizes by 4 points -rcParams.update({key: rcParams[key] + 4 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +# Increase all font sizes by 12 points +rcParams.update({key: rcParams[key] + 12 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # Device colors DEVICE_COLORS = { @@ -353,7 +353,7 @@ def plot_latency_smoothed_group(normalized_name, dir_label_pairs, metric_name, # Plot the workload line and get its color color = get_color_for_label(label) - line = plt.plot(time_minutes, smooth_values, alpha=0.8, linewidth=1.5, label=label, color=color) + line = plt.plot(time_minutes, smooth_values, alpha=0.8, linewidth=2.0, label=label, color=color) line_color = line[0].get_color() has_data = True @@ -369,7 +369,6 @@ def plot_latency_smoothed_group(normalized_name, dir_label_pairs, metric_name, if has_data: plt.xlabel('Time (minutes)') plt.ylabel(f'Latency (ms)') - plt.grid(True, alpha=0.3) # Apply chunk-level y-axis limits plt.ylim(y_min, y_max) @@ -378,6 +377,8 @@ def plot_latency_smoothed_group(normalized_name, dir_label_pairs, metric_name, plt.legend() plt.tight_layout() + ax = plt.gca() + ax.grid(True, linewidth=1.0, alpha=0.5) output_file = output_dir / f"{normalized_name}_{metric_name}_smoothed_{window_seconds}s.png" plt.savefig(output_file, dpi=300, bbox_inches='tight', pad_inches=0) diff --git a/eval/plot_throughput.py b/eval/plot_throughput.py index e12ce63..ae4f5fa 100644 --- a/eval/plot_throughput.py +++ b/eval/plot_throughput.py @@ -16,8 +16,8 @@ import numpy as np import data_cache -# Increase all font sizes by 4 points -rcParams.update({key: rcParams[key] + 4 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) +# Increase all font sizes by 12 points +rcParams.update({key: rcParams[key] + 12 for key in rcParams if "size" in key and isinstance(rcParams[key], (int, float))}) # Device colors DEVICE_COLORS = { @@ -384,7 +384,7 @@ def plot_throughput_group(normalized_name, dir_label_pairs, metric_name, # Plot the workload line and get its color color = get_color_for_label(label) - line = plt.plot(time_minutes, scaled_throughputs, label=label, color=color) + line = plt.plot(time_minutes, scaled_throughputs, label=label, color=color, linewidth=3) line_color = line[0].get_color() has_data = True @@ -408,6 +408,9 @@ def plot_throughput_group(normalized_name, dir_label_pairs, metric_name, plt.legend() plt.tight_layout() + ax = plt.gca() + ax.yaxis.set_label_coords(x=-0.1, y=0.35) + ax.grid(True, linewidth=1.0, alpha=0.5) # Save with chunk size in path output_file = output_dir / f"{normalized_name}_{metric_name}_throughput.png"