Mass Spectrum
Chart overview
Mass spectra display ion abundance as vertical lines at each mass-to-charge ratio, allowing identification of molecular ions, isotope patterns, and fragmentation pathways.
Key points
- Analytical chemists and proteomics researchers annotate the molecular ion peak, base peak, and characteristic fragment ions to confirm compound identity.
- High-resolution mass spectra are essential for elemental composition determination in natural product and pharmaceutical research.
Create a Mass Spectrum with your data using AI — no coding required.
Python Tutorial
How to create a mass spectrum in Python
Use the full tutorial for implementation details, troubleshooting, and chart variations in matplotlib, seaborn, and plotly.
Complete Guide to Scientific Data VisualizationExample Visualization

Create This Chart Now
Generate publication-ready mass spectrums with AI in seconds. No coding required – just describe your data and let AI do the work.
View example prompt
"Create a mass spectrum stick plot from my data. Plot m/z on the x-axis and relative intensity (normalized to 100%) on the y-axis using vertical lines. Annotate the molecular ion peak [M+H]+ and the top 5 most abundant fragment ions with their m/z values. Use journal formatting with Arial font and no top or right spines."
How to create this chart in 30 seconds
Upload Data
Drag & drop your Excel or CSV file. Plotivy securely processes it in your browser.
AI Generation
Our AI analyzes your data and generates the Mass Spectrum code automatically.
Customize & Export
Tweak the design with natural language, then export as high-res PNG, SVG or PDF.
Newsletter
Get one weekly tip for better mass spectrums
Join researchers receiving concise Python plotting techniques to improve chart clarity and reduce revision cycles.
Python Code Example
Console Output
Figure saved: plotivy-mass-spectrum.png
Common Use Cases
- 1Confirming molecular weight and fragmentation pattern of synthesized compounds
- 2Identifying unknown metabolites in untargeted metabolomics workflows
- 3Characterizing peptide sequences through tandem MS fragmentation spectra
- 4Detecting isotope distributions for elemental composition confirmation
Pro Tips
Normalize all intensities to the base peak set to 100% for cross-sample comparison
Use matplotlib vlines instead of bar for authentic stick-spectrum appearance
Annotate only peaks above a threshold (e.g., >5% relative abundance) to avoid cluttered labels
Add isotope pattern envelopes as a shaded overlay when presenting high-resolution data
Frequently asked questions
When should you use a mass spectrum?
Mass spectra display ion abundance as vertical lines at each mass-to-charge ratio, allowing identification of molecular ions, isotope patterns, and fragmentation pathways. Analytical chemists and proteomics researchers annotate the molecular ion peak, base peak, and characteristic fragment ions to confirm compound identity. Common applications include confirming molecular weight and fragmentation pattern of synthesized compounds, identifying unknown metabolites in untargeted metabolomics workflows, and characterizing peptide sequences through tandem MS fragmentation spectra.
Which Python libraries can create a mass spectrum?
A mass spectrum can be built in Python with matplotlib and numpy — matplotlib for precise control over axes, annotations, and journal styling and numpy. In Plotivy you describe the figure and it writes the matplotlib code for you.
Can I make a mass spectrum without writing Python code?
Yes. Describe the mass spectrum you need in plain language and upload your dataset — Plotivy's AI writes the Python code and renders a publication-ready figure. You still get the full, editable matplotlib source, so nothing is locked in a black box.
What are best practices for a clear mass spectrum?
Normalize all intensities to the base peak set to 100% for cross-sample comparison. Use matplotlib vlines instead of bar for authentic stick-spectrum appearance.
Long-tail keyword opportunities
High-intent chart variations
Library comparison for this chart
matplotlib
Best when you need full control over axis formatting, annotation placement, and journal-specific styling for mass-spectrum.
numpy
Useful in specialized workflows that complement core Python plotting libraries for mass-spectrum analysis tasks.
Scientific Chart Selection Cheat Sheet
Not sure whether to use a Violin Plot, Box Plot, or Ridge Plot? Download our single-page reference mapping the most-used scientific chart types, exactly when to use them, and the core Matplotlib/Seaborn functions.