Skip to content

Commit

Permalink
plot padding
Browse files Browse the repository at this point in the history
  • Loading branch information
matanbroner committed May 12, 2023
1 parent 3873e7f commit 6c6f51e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion 5GTC/pkg/performance_logger/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def plot_subflow_features(
for i in range(len(subflow_data)):
# Left pad the data with 0s so that all subflows have the same length
subflow_data[i] = np.pad(
subflow_data[i], (0, number_iterations - len(subflow_data[i])), "constant"
subflow_data[i], (number_iterations - len(subflow_data[i]), 0), "constant"
)
ax.plot(subflow_data[i])
# Set the title and labels
Expand All @@ -107,6 +107,7 @@ def plot_transfer(subflow_data, iteration_ms=500, subflow_keys=None):
# Create a new figure
fig = Figure()
ax = fig.add_subplot(111)
number_iterations = max([len(subflow_data[subflow]["tcpi_bytes_acked"]) for subflow in subflow_data])
for subflow in subflow_data:
# Calculate the throughput
iterations_per_minute = (60 * 1000) / iteration_ms
Expand Down
2 changes: 1 addition & 1 deletion 5GTC/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def plot_subflow_info_from_db(

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plot the data from a performance log")
parser.add_argument("--iteration_id", type=str, help="The iteration id to plot")
parser.add_argument("--iteration-id", type=str, help="The iteration id to plot")
parser.add_argument("--field", type=str, help="The field to plot")
parser.add_argument("--xlabel", type=str, help="The x-axis label", default=None)
parser.add_argument("--ylabel", type=str, help="The y-axis label", default=None)
Expand Down

0 comments on commit 6c6f51e

Please sign in to comment.