drizzlepac
drizzlepac copied to clipboard
TweakReg figures not closed? (when interactive mode turned off)
Hi I came across a problem when make a plot after run the TweakReg task: When plot a new figure, say, a scatter plot using pylab, which is not related to TweakReg, the TweakReg data (vector plot/hist plot) go on top of the new figure. I was wondering is it possible turn the matplotlib settings back to normal at the end of TweakReg task? Many thanks!
example code:
from astropy.io import ascii
import pylab as pl
tweakreg.TweakReg(files=fs_fits, configobj=f_cfg, refimage=f_ref, catfile='mtxy.lst',
refcat=self.f_cat, updatehdr=updatehdr, wcsname=wcsname)
xys = ascii.read(self.outdir+'shifts.txt', data_start=1)
pl.errorbar(xys['col2'], xys['col3'], xerr=xys['col6'], yerr=xys['col7'], fmt='o', alpha=0.8)
pl.savefig('test.png')
pl.close()
The test.png was supposed to be scatter plot of the frame shifts, however, it turns out be a vector plot of TweakReg task on top of the scatter plot.
versions:
- TweakReg Version 1.4.3(01-Jul-2016)
- Python Version 2.7.13
CC: @stsci-hack I think this would be down your alley...
PR #96 has been submitted to correct this issue. Once it has been tested, it should solve the user's problem.