Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: webrtc/rtc_tools/event_log_visualizer/plot_python.cc

Issue 2826313004: Added -show_detector_state which show the detector state in the total bitrate graph. (Closed)
Patch Set: kVertical ---> kHorizontal Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/rtc_tools/event_log_visualizer/plot_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_tools/event_log_visualizer/plot_python.cc
diff --git a/webrtc/rtc_tools/event_log_visualizer/plot_python.cc b/webrtc/rtc_tools/event_log_visualizer/plot_python.cc
index d4ae043a1b5c66f0f8651159e942197832f938ad..c3b5918919dcfeb636364017c3eb9cfed9afa4fb 100644
--- a/webrtc/rtc_tools/event_log_visualizer/plot_python.cc
+++ b/webrtc/rtc_tools/event_log_visualizer/plot_python.cc
@@ -74,6 +74,8 @@ void PythonPlot::Draw() {
printf("y%zu = [v for dup in y%zu for v in [dup, dup]]\n", i, i);
printf(
"plt.plot(x%zu[1:], y%zu[:-1], color=rgb_colors[%zu], "
+ "path_effects=[pe.Stroke(linewidth=2, foreground='black'), "
+ "pe.Normal()], "
"label=\'%s\')\n",
i, i, i, series_list_[i].label.c_str());
} else if (series_list_[i].style == DOT_GRAPH) {
@@ -85,6 +87,36 @@ void PythonPlot::Draw() {
printf("raise Exception(\"Unknown graph type\")\n");
}
}
+
+ // IntervalSeries
terelius 2017/07/11 21:35:52 printf("interval_colors = ['#ff8e82','#5092fc','#c
philipel 2017/07/14 11:54:57 Done.
+ for (size_t i = 0; i < interval_list_.size(); i++) {
+ // List intervals
+ printf("\n# === IntervalSeries: %s ===\n",
+ interval_list_[i].label.c_str());
+ printf("ival%zu = [", i);
+ if (interval_list_[i].intervals.size() > 0) {
+ printf("(%G, %G)", interval_list_[i].intervals[0].begin,
+ interval_list_[i].intervals[0].end);
+ }
+ for (size_t j = 1; j < interval_list_[i].intervals.size(); j++) {
+ printf(", (%G, %G)", interval_list_[i].intervals[j].begin,
+ interval_list_[i].intervals[j].end);
+ }
+ printf("]\n");
+
+ printf("for i in range(0, %zu):\n", interval_list_[i].intervals.size());
+ if (interval_list_[i].orientation == IntervalSeries::kVertical) {
+ printf(
terelius 2017/07/11 21:35:52 printf("plt.axhspan(ival%zu[i][0], ival%zu[i][1],
philipel 2017/07/14 11:54:57 Done.
+ " plt.axhspan(ival%zu[i][0], ival%zu[i][1], facecolor='%s', "
+ "alpha=0.3)\n",
+ i, i, interval_list_[i].color.c_str());
+ } else {
+ printf(
+ " plt.axvspan(ival%zu[i][0], ival%zu[i][1], facecolor='%s', "
+ "alpha=0.3)\n",
+ i, i, interval_list_[i].color.c_str());
+ }
terelius 2017/07/11 21:35:52 Is there some label that helps the user understand
philipel 2017/07/14 11:54:57 Done.
+ }
}
printf("plt.xlim(%f, %f)\n", xaxis_min_, xaxis_max_);
@@ -103,6 +135,7 @@ PythonPlotCollection::~PythonPlotCollection() {}
void PythonPlotCollection::Draw() {
printf("import matplotlib.pyplot as plt\n");
+ printf("import matplotlib.patheffects as pe\n");
printf("import colorsys\n");
for (size_t i = 0; i < plots_.size(); i++) {
printf("plt.figure(%zu)\n", i);
« no previous file with comments | « webrtc/rtc_tools/event_log_visualizer/plot_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698