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

Side by Side Diff: webrtc/tools/event_log_visualizer/plot_python.cc

Issue 2653343004: Add new step graph type to event log visualization tool (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « webrtc/tools/event_log_visualizer/plot_protobuf.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "label=\'%s\')\n", 58 "label=\'%s\')\n",
59 i, i, i, i, series_list_[i].label.c_str()); 59 i, i, i, i, series_list_[i].label.c_str());
60 } else if (series_list_[i].style == LINE_GRAPH) { 60 } else if (series_list_[i].style == LINE_GRAPH) {
61 printf("plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\')\n", i, 61 printf("plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\')\n", i,
62 i, i, series_list_[i].label.c_str()); 62 i, i, series_list_[i].label.c_str());
63 } else if (series_list_[i].style == LINE_DOT_GRAPH) { 63 } else if (series_list_[i].style == LINE_DOT_GRAPH) {
64 printf( 64 printf(
65 "plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\', " 65 "plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\', "
66 "marker='.')\n", 66 "marker='.')\n",
67 i, i, i, series_list_[i].label.c_str()); 67 i, i, i, series_list_[i].label.c_str());
68 } else if (series_list_[i].style == LINE_STEP_GRAPH) {
69 // Draw lines from (x[0],y[0]) to (x[1],y[0]) to (x[1],y[1]) and so on
70 // to illustrate the "steps". This can be expressed by duplicating all
71 // elements except the first in x and the last in y.
72 printf("x%zu = [v for dup in x%zu for v in [dup, dup]]\n", i, i);
73 printf("y%zu = [v for dup in y%zu for v in [dup, dup]]\n", i, i);
74 printf(
75 "plt.plot(x%zu[1:], y%zu[:-1], color=rgb_colors[%zu], "
76 "label=\'%s\')\n",
77 i, i, i, series_list_[i].label.c_str());
68 } else { 78 } else {
69 printf("raise Exception(\"Unknown graph type\")\n"); 79 printf("raise Exception(\"Unknown graph type\")\n");
70 } 80 }
71 } 81 }
72 } 82 }
73 83
74 printf("plt.xlim(%f, %f)\n", xaxis_min_, xaxis_max_); 84 printf("plt.xlim(%f, %f)\n", xaxis_min_, xaxis_max_);
75 printf("plt.ylim(%f, %f)\n", yaxis_min_, yaxis_max_); 85 printf("plt.ylim(%f, %f)\n", yaxis_min_, yaxis_max_);
76 printf("plt.xlabel(\'%s\')\n", xaxis_label_.c_str()); 86 printf("plt.xlabel(\'%s\')\n", xaxis_label_.c_str());
77 printf("plt.ylabel(\'%s\')\n", yaxis_label_.c_str()); 87 printf("plt.ylabel(\'%s\')\n", yaxis_label_.c_str());
(...skipping 18 matching lines...) Expand all
96 } 106 }
97 107
98 Plot* PythonPlotCollection::AppendNewPlot() { 108 Plot* PythonPlotCollection::AppendNewPlot() {
99 Plot* plot = new PythonPlot(); 109 Plot* plot = new PythonPlot();
100 plots_.push_back(std::unique_ptr<Plot>(plot)); 110 plots_.push_back(std::unique_ptr<Plot>(plot));
101 return plot; 111 return plot;
102 } 112 }
103 113
104 } // namespace plotting 114 } // namespace plotting
105 } // namespace webrtc 115 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/tools/event_log_visualizer/plot_protobuf.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698