CcpnForum
Turning negative contours off/on. - Printable Version

+- CcpnForum (https://www.ccpn.ac.uk/forums)
+-- Forum: CcpNmr Analysis Version 3 (https://www.ccpn.ac.uk/forums/forumdisplay.php?fid=4)
+--- Forum: V3 Macros (https://www.ccpn.ac.uk/forums/forumdisplay.php?fid=14)
+--- Thread: Turning negative contours off/on. (/showthread.php?tid=56)



Turning negative contours off/on. - ElizaP - 11-27-2019

Dear All,

Here is a short macro for turning the negative contours off. It is useful if you set it up as two user shortcuts. 
It works on all visible spectra in current Spectrum Display.

To turn negative contours off:

for spectrumView in (v for v in current.strip.spectrumViews if v.isVisible()):
   spectrumToTurnOff = project.getByPid(spectrumView.spectrum.pid)
   spectrumToTurnOff.includeNegativeContours = False
   spectrumView.displayNegativeContours = False



To turn negative contours on:

for spectrumView in (v for v in current.strip.spectrumViews if v.isVisible()):
   spectrumToTurnOn = project.getByPid(spectrumView.spectrum.pid)
   spectrumToTurnOn.includeNegativeContours = True
   spectrumView.displayNegativeContours = True


Thanks, 
Eliza