-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Combine plots #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to go through and run it to understand the functionality, but these are some quick comments.
This pull request introduces 1 alert when merging f6919de into 11fc554 - view on LGTM.com new alerts:
|
This code can remove the warning information on std console. If we don't use it, I will get warning information like this on my PC @matthewfeickert Do we need to reserve this code? |
No. This doesn't matter and is just normal for TensorFlow. |
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
- Coverage 65.52% 61.91% -3.61%
==========================================
Files 9 10 +1
Lines 467 470 +3
Branches 57 66 +9
==========================================
- Hits 306 291 -15
- Misses 143 160 +17
- Partials 18 19 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
def subplot(y_label, column, output, directory, filename): | ||
|
||
x_value = output["_runtime"] | ||
if y_label == "Network Traffic (bytes)": | ||
y_value1 = output.get(column[0], [0] * len(x_value)) | ||
y_value2 = output.get(column[1], [0] * len(x_value)) | ||
plt.plot(x_value, y_value1, ls="--", label="send") | ||
plt.plot(x_value, y_value2, label="recv") | ||
plt.legend(loc="upper left") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the plotting code should get switched over to using the matplotlib subplots API that I sent you earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewfeickert So all the graph plots will be in one picture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. There are lots of examples on using matplotlib.pyplot.subplots
. Start with the docs https://matplotlib.org/3.3.0/api/_as_gen/matplotlib.pyplot.subplots.html and then there are tons of results on google.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coolalexzb Okay, following up here finally (sorry). What I mean here is that using the plot.plot
API can be problematic as it is global and so you have to worry about dealing with a universal canvas. It is more robust to use the plt.subplots
API. So you could simply create a function with a more descriptive name that takes similar arguments but then generates a figure and axis pair from
fig, axis = plt.subplots()
ax.set_xlabel("Time (seconds)")
ax.set_ylabel(y_label)
# ...
return fig, axis
and soforth. This is a more robust solution and then actually allows you to return the fig
and axis
objects
fig, axis = your_function(y_label, column, output)
# Do other things with fig and axis if you need
fig.savefig(directory / filename)
@coolalexzb There were things in here that didn't get properly rebased and now need to get removed again. Let's start having me review PRs from now on. |
This PR aims to provide solution to issue#21.
User can use the command
to run severalcomputations in one-time run and get the combination plots of running results and separation plots of running result like the following: