Subject: Re: macro to zoom in/out all the opened spectra at once
From: nmrworker
Date: Jun 29, 2010

Previous: 747

it works like charming!! thanks.

--- In nmr_sparky@yahoogroups.com , Tom Goddard goddard@... wrote:

The View class pixel_size attribute would allow you to control zooming

http://www.cgl.ucsf.edu/home/sparky/sparky-python.txt

For example,

v.pixel_size = [0.5 * s for s in v.pixel_size]

Tom


It should be pretty easy by modifying the below macro that sets
contour levels for all the opened spectra at once: just change zoom
value to be like 2*zoom or 0.5*zoom. However, which module can I
retrieve this parameter?

def set_contour_levels():
p = session.project
from sparky import Contour_Levels
plev = Contour_Levels()
plev.lowest = 1000
...
nlev = Contour_Levels()
nlev.lowest = -1000
...
for v in p.view_list():
v.positive_levels = plev
v.negative_levels = nlev
session.add_command(kl, Set all contour levels, set_contour_levels)
macro