Exporting the graphs as SVG, PNG, JPG, etc. - MateuszFido/LCMSpector GitHub Wiki

LC-Inspector uses the interactive pyqtgraph library to display chromatography and mass spectrometry data, which allows for interactive graph viewing, easy data transformation (sum, average, log, power operations, etc.) and exporting.

The plot options window can be opened by right-clicking any plot in LC-Inspector.

There are multiple ways of editing and exporting the data:

1. Copying to system clipboard
2. Exporting as a file
3. Exporting as a matplotlib window
4. Exporting the data as CSV

Copying to system clipboard

You can easily copy a graph directly to clipboard using the export interface.

Example:

Exporting as a file

Similarly, images can be saved as a file, specifying the dimensions and the export path.

You can export the entire scene, only the plot in question, or only the currently visible area.

For more information on exporting, check out PyQtGraph's documentation: https://pyqtgraph.readthedocs.io/en/latest/user_guide/exporting.html

Exporting as a matplotlib window

PyQtGraph can easily convert its graphs to interactive matplotlib windows.

Matplotlib is a very well-established and mature graphing library for Python and many users may be more familiar with it.

The conversion loses annotations, legends, and titles but maintains flexibility for users who are more familiar with matplotlib's interface. The matplotlib window can then itself be exported into many other file formats, including SVG, PNG, PDF, PGF, and TIFF.

Exporting the data as CSV

Similarly, the underlying raw data of every plot window can be exported into a CSV file.

Here is an example of exporting the m/z window from one mass spectrometry data scan:

If there are many traces on the same plot (e.g., extracted ion chromatograms containing many different ion traces for the same compound), they can all be exported as separate Y axes with a common X axis. This can be set in the columnMode variable of the export window.

This is very handy if you use separate graphing libraries or external software to create your figures.

Dataset used:

https://massive.ucsd.edu/ProteoSAFe/dataset.jsp?task=0cf7682cf8e747ceb5fa071c1f283ede

Related publication DOI: 10.1021/acs.analchem.2c04859