| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // There is a plt.bar function that draws bar plots, | 51 // There is a plt.bar function that draws bar plots, |
| 52 // but it is *way* too slow to be useful. | 52 // but it is *way* too slow to be useful. |
| 53 printf( | 53 printf( |
| 54 "plt.vlines(x%zu, map(lambda t: min(t,0), y%zu), map(lambda t: " | 54 "plt.vlines(x%zu, map(lambda t: min(t,0), y%zu), map(lambda t: " |
| 55 "max(t,0), y%zu), color=rgb_colors[%zu], " | 55 "max(t,0), y%zu), color=rgb_colors[%zu], " |
| 56 "label=\'%s\')\n", | 56 "label=\'%s\')\n", |
| 57 i, i, i, i, series[i].label.c_str()); | 57 i, i, i, i, series[i].label.c_str()); |
| 58 } else if (series[i].style == LINE_GRAPH) { | 58 } else if (series[i].style == LINE_GRAPH) { |
| 59 printf("plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\')\n", i, | 59 printf("plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\')\n", i, |
| 60 i, i, series[i].label.c_str()); | 60 i, i, series[i].label.c_str()); |
| 61 } else if (series[i].style == LINE_DOT_GRAPH) { |
| 62 printf( |
| 63 "plt.plot(x%zu, y%zu, color=rgb_colors[%zu], label=\'%s\', " |
| 64 "marker='.')\n", |
| 65 i, i, i, series[i].label.c_str()); |
| 61 } else { | 66 } else { |
| 62 printf("raise Exception(\"Unknown graph type\")\n"); | 67 printf("raise Exception(\"Unknown graph type\")\n"); |
| 63 } | 68 } |
| 64 } | 69 } |
| 65 } | 70 } |
| 66 | 71 |
| 67 printf("plt.xlim(%f, %f)\n", xaxis_min, xaxis_max); | 72 printf("plt.xlim(%f, %f)\n", xaxis_min, xaxis_max); |
| 68 printf("plt.ylim(%f, %f)\n", yaxis_min, yaxis_max); | 73 printf("plt.ylim(%f, %f)\n", yaxis_min, yaxis_max); |
| 69 printf("plt.xlabel(\'%s\')\n", xaxis_label.c_str()); | 74 printf("plt.xlabel(\'%s\')\n", xaxis_label.c_str()); |
| 70 printf("plt.ylabel(\'%s\')\n", yaxis_label.c_str()); | 75 printf("plt.ylabel(\'%s\')\n", yaxis_label.c_str()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 } | 94 } |
| 90 | 95 |
| 91 Plot* PythonPlotCollection::append_new_plot() { | 96 Plot* PythonPlotCollection::append_new_plot() { |
| 92 Plot* plot = new PythonPlot(); | 97 Plot* plot = new PythonPlot(); |
| 93 plots.push_back(std::unique_ptr<Plot>(plot)); | 98 plots.push_back(std::unique_ptr<Plot>(plot)); |
| 94 return plot; | 99 return plot; |
| 95 } | 100 } |
| 96 | 101 |
| 97 } // namespace plotting | 102 } // namespace plotting |
| 98 } // namespace webrtc | 103 } // namespace webrtc |
| OLD | NEW |