diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc index 416fd98849..af1024312f 100644 --- a/modules/audio_processing/test/audio_processing_simulator.cc +++ b/modules/audio_processing/test/audio_processing_simulator.cc @@ -55,12 +55,13 @@ void WriteEchoLikelihoodGraphFileHeader(std::ofstream* output_file) { void WriteEchoLikelihoodGraphFileFooter(std::ofstream* output_file) { (*output_file) << "])" << std::endl - << "x = np.arange(len(y))*.01" << std::endl - << "plt.plot(x, y)" << std::endl - << "plt.ylabel('Echo likelihood')" << std::endl - << "plt.xlabel('Time (s)')" << std::endl - << "plt.ylim([0,1])" << std::endl - << "plt.show()" << std::endl; + << "if __name__ == '__main__':" << std::endl + << " x = np.arange(len(y))*.01" << std::endl + << " plt.plot(x, y)" << std::endl + << " plt.ylabel('Echo likelihood')" << std::endl + << " plt.xlabel('Time (s)')" << std::endl + << " plt.ylim([0,1])" << std::endl + << " plt.show()" << std::endl; } } // namespace