This is the export done by API.
self.remove_all_items_in_plot_area(plot_widget)
self.gen_plots(file_path, meas_data[file_path], plot_widget, plt_type='export')
QtGui.QApplication.processEvents()
exporter = pg.exporters.ImageExporter(plot_widget.scene())
exporter.parameters()['width'] = 2000
# exporter.parameters()['height'] = 1600
QtGui.QApplication.processEvents()
exporter.export(export_name)