Problem with Peak Amplitudes Using Stackplot
Problem with Peak Amplitudes Using Stackplot
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)".
Re: Problem with Peak Amplitudes Using Stackplot
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.
Thanks.
Re: Problem with Peak Amplitudes Using Stackplot
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 (169.1 KiB) Viewed 7228 times
-
- EasySpin Creator
- Posts: 1120
- Joined: Mon Jul 21, 2014 10:11 pm
- Location: University of Washington
Re: Problem with Peak Amplitudes Using Stackplot
Keep in mind that
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.
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 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.