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

Unified Diff: webrtc/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: Feedback Created 3 years, 8 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
Index: webrtc/tools/event_log_visualizer/plot_python.cc
diff --git a/webrtc/tools/event_log_visualizer/plot_python.cc b/webrtc/tools/event_log_visualizer/plot_python.cc
index 59270a0b9516d53abe98e092d63dfb240ae34461..b408d808ca19457c6b67620d040f70ebbc06060c 100644
--- a/webrtc/tools/event_log_visualizer/plot_python.cc
+++ b/webrtc/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) {
@@ -81,6 +83,10 @@ void PythonPlot::Draw() {
"plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\', "
"marker='o', ls=' ')\n",
i, i, i, series_list_[i].label.c_str());
+ } else if (series_list_[i].style == VSPAN_GRAPH) {
+ printf("for i in range(0, %zu, 2):\n", series_list_[i].points.size());
+ printf(" plt.axvspan(x%zu[i], x%zu[i+1], facecolor='%s', alpha=0.3)\n",
+ i, i, series_list_[i].color.c_str());
} else {
printf("raise Exception(\"Unknown graph type\")\n");
}
@@ -103,6 +109,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);

Powered by Google App Engine
This is Rietveld 408576698