Problem with Peak Amplitudes Using Stackplot

A place to report and discuss potential bugs
Post Reply
es1055
Newbie
Posts: 4
Joined: Wed Jul 01, 2015 7:52 am

Problem with Peak Amplitudes Using Stackplot

Post by es1055 »

When I attempt to make a stackplot of a frequency swept simulation the peak amplitudes come out wrong. They increase going up the plot. In the attached picture, (a) shows the stackplot with the amplitude problem made using script1. (b) shows the overlapping top and bottom spectra from the stackplot. (c) is what (b) should look like and was generated using script2 which is nearly identical to script1 except that "theta1=(2.8:5:47.8);" at the top is replaced with "theta1=(2.8:45:47.8);" and "stackplot(Freq,Sim)" at the bottom is replaced with "plot(Freq,Sim)".
Attachments
Script2.m
(3.14 KiB) Downloaded 406 times
Script1.m
(3.14 KiB) Downloaded 429 times
Stackplotproblem.png
Stackplotproblem.png (166.7 KiB) Viewed 3853 times
es1055
Newbie
Posts: 4
Joined: Wed Jul 01, 2015 7:52 am

Re: Problem with Peak Amplitudes Using Stackplot

Post by es1055 »

The problem appears to be related to doing a stackplot on two simulations added together. If I do a stackplot of the NV or P1 simulation alone the amplitudes are correct.


Thanks.
es1055
Newbie
Posts: 4
Joined: Wed Jul 01, 2015 7:52 am

Re: Problem with Peak Amplitudes Using Stackplot

Post by es1055 »

I stand corrected. This seems to only happen with the NV simulation. The P1 simulation is always fine unless it is added to the NV simulation and stackplotted.
Attachments
stackplotproblem.png
stackplotproblem.png (169.1 KiB) Viewed 3841 times
Stefan Stoll
EasySpin Creator
Posts: 1057
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Problem with Peak Amplitudes Using Stackplot

Post by Stefan Stoll »

Keep in mind that stackplot rescales the individual spectra so that they all have the same vertical extent. You can switch that scaling off:

Code: Select all

stackplot(Freq,Sim,0,2e5);
The third argument (0) gives the scaling - when set to zero, scaling is skipped.
The fourth argument gives the vertical offset between spectra. If you don't scale, you have to set this to a value that is on the same order of magnitude as the intensity in your spectra.
Post Reply