Link x-axes across all figures for synchronized zooming in the

interactive eventlogvisualizer plots.

Bug: none
Change-Id: I27b414ab8a7f1b5f1983ec35e61c4eccb89e89d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128876
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Konrad Hofbauer <hofbauer@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27294}
This commit is contained in:
Konrad Hofbauer
2019-03-26 13:23:54 +01:00
committed by Commit Bot
parent 081bec34bf
commit 225f4f6cbe

View File

@ -169,6 +169,12 @@ void PythonPlotCollection::Draw() {
printf("import colorsys\n");
for (size_t i = 0; i < plots_.size(); i++) {
printf("plt.figure(%zu)\n", i);
// Link x-axes across all figures for synchronized zooming.
if (i == 0) {
printf("axis0 = plt.subplot(111)\n");
} else {
printf("plt.subplot(111, sharex=axis0)\n");
}
plots_[i]->Draw();
}
printf("plt.show()\n");