| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } else if (series_list_[i].style == LINE_STEP_GRAPH) { | 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 | 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 | 70 // to illustrate the "steps". This can be expressed by duplicating all |
| 71 // elements except the first in x and the last in y. | 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); | 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); | 73 printf("y%zu = [v for dup in y%zu for v in [dup, dup]]\n", i, i); |
| 74 printf( | 74 printf( |
| 75 "plt.plot(x%zu[1:], y%zu[:-1], color=rgb_colors[%zu], " | 75 "plt.plot(x%zu[1:], y%zu[:-1], color=rgb_colors[%zu], " |
| 76 "label=\'%s\')\n", | 76 "label=\'%s\')\n", |
| 77 i, i, i, series_list_[i].label.c_str()); | 77 i, i, i, series_list_[i].label.c_str()); |
| 78 } else if (series_list_[i].style == DOT_GRAPH) { |
| 79 printf( |
| 80 "plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\', " |
| 81 "marker='.', ls=' ')\n", |
| 82 i, i, i, series_list_[i].label.c_str()); |
| 78 } else { | 83 } else { |
| 79 printf("raise Exception(\"Unknown graph type\")\n"); | 84 printf("raise Exception(\"Unknown graph type\")\n"); |
| 80 } | 85 } |
| 81 } | 86 } |
| 82 } | 87 } |
| 83 | 88 |
| 84 printf("plt.xlim(%f, %f)\n", xaxis_min_, xaxis_max_); | 89 printf("plt.xlim(%f, %f)\n", xaxis_min_, xaxis_max_); |
| 85 printf("plt.ylim(%f, %f)\n", yaxis_min_, yaxis_max_); | 90 printf("plt.ylim(%f, %f)\n", yaxis_min_, yaxis_max_); |
| 86 printf("plt.xlabel(\'%s\')\n", xaxis_label_.c_str()); | 91 printf("plt.xlabel(\'%s\')\n", xaxis_label_.c_str()); |
| 87 printf("plt.ylabel(\'%s\')\n", yaxis_label_.c_str()); | 92 printf("plt.ylabel(\'%s\')\n", yaxis_label_.c_str()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 106 } | 111 } |
| 107 | 112 |
| 108 Plot* PythonPlotCollection::AppendNewPlot() { | 113 Plot* PythonPlotCollection::AppendNewPlot() { |
| 109 Plot* plot = new PythonPlot(); | 114 Plot* plot = new PythonPlot(); |
| 110 plots_.push_back(std::unique_ptr<Plot>(plot)); | 115 plots_.push_back(std::unique_ptr<Plot>(plot)); |
| 111 return plot; | 116 return plot; |
| 112 } | 117 } |
| 113 | 118 |
| 114 } // namespace plotting | 119 } // namespace plotting |
| 115 } // namespace webrtc | 120 } // namespace webrtc |
| OLD | NEW |