Re: tvimage, imcontour and ps dimensions [message #43513] |
Mon, 18 April 2005 01:56 |
burkina
Messages: 32 Registered: February 2005
|
Member |
|
|
Thank you David,
that did the trick!
Actually, pos = [0.1, 0.1, 0.9, 0.9] seems to be the default (am I
right?), you need something more than 0.1 to get the y axis label of
imcontour inside the ps.
Thanks again,
Stefano
|
|
|
Re: tvimage, imcontour and ps dimensions [message #43517 is a reply to message #43513] |
Sun, 17 April 2005 15:36  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Stefano writes:
> Here is my code. I get the same problem even if I do not redefine all
> the ! variables.
>
> Thanks,
>
> Stefano
>
> file='file.fits'
> im=readfits(file,hdr)
>
> file2='file2.fits'
> hst=readfits(file2,hdr2)
>
> hextract, hst, hdr2, 100, 480, 220, 460
>
> hastrom, im, hdr, hdr2, MISSING=0
>
> sm=smooth(im,15,/edge_truncate)
>
> set_plot, 'ps'
> device, filename='test_paper.ps', xsize=20, ysize=20, /color
>
> !P.charsize=0.8
> !P.thick=5
> !X.thick=3
> !Y.thick=3
> !P.charthick=3
>
> erase
>
> tvimage,bytscl(-hst,min=-20,max=0),/keep_aspect, position=pos
>
> imcontour, alog(sm), hdr, nlevels=3, min_value=-0.6, max_value=3,
> position=pos, /TYPE, /noerase,color=fsc_color('black'), subtitle="",
> title="Test"
>
> device, /close_file
Ah, right. I see you *were* reading the header documentation.
Sometimes that's the problem. :-)
What you want to do is define the variable "pos" before
you use it in the TVIMAGE command. That will solve
all your problems, I think:
pos = [0.1, 0.1, 0.9, 0.9]
tvimage,bytscl(-hst,min=-20,max=0),/keep_aspect, position=pos
imcontour, alog(sm), hdr, nlevels=3, min_value=-0.6, max_value=3, $
position=pos, /TYPE, /noerase,color=fsc_color('black'), $
subtitle="", title="Test"
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: tvimage, imcontour and ps dimensions [message #43519 is a reply to message #43517] |
Sun, 17 April 2005 03:14  |
burkina
Messages: 32 Registered: February 2005
|
Member |
|
|
Here is my code. I get the same problem even if I do not redefine all
the ! variables.
Thanks,
Stefano
file='file.fits'
im=readfits(file,hdr)
file2='file2.fits'
hst=readfits(file2,hdr2)
hextract, hst, hdr2, 100, 480, 220, 460
hastrom, im, hdr, hdr2, MISSING=0
sm=smooth(im,15,/edge_truncate)
set_plot, 'ps'
device, filename='test_paper.ps', xsize=20, ysize=20, /color
!P.charsize=0.8
!P.thick=5
!X.thick=3
!Y.thick=3
!P.charthick=3
erase
tvimage,bytscl(-hst,min=-20,max=0),/keep_aspect, position=pos
imcontour, alog(sm), hdr, nlevels=3, min_value=-0.6, max_value=3,
position=pos, /TYPE, /noerase,color=fsc_color('black'), subtitle="",
title="Test"
device, /close_file
|
|
|
Re: tvimage, imcontour and ps dimensions [message #43528 is a reply to message #43519] |
Fri, 15 April 2005 14:53  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
burkina writes:
> I have a problem with ps output.
> I have an astronomical image with some contours on it. I use tvimage
> and imcontour.
> So far so good.
> I want to produce several similar (but different!) images with exactly
> the same ps width and height size.
> The ps file is created in the script in this way:
>
> set_plot, 'ps'
> device, filename='test.ps', xsize=20, ysize=20, /color
>
> The problem is that in this way (of course no matter the x and ysize),
> I get the y labels of the imcontour outside of the ps file, the image
> is truncated at the axis.
> It happens the same if I work on the screen, but if I resize it
> manually and then retry an imcontour, after a few trial I get the right
> result.
> If then I use again the ps device, I also get all the image on the file
> but, since I resize the screen manually, the actual size of the image
> inside the ps is everytime different!
>
> What am I doing wrong?
Humm. I'm not sure even when you get it to work
you are doing anything right. :-)
Why don't you show us the code. It might offer
a few more clues. But I suspect maybe you haven't
read the documentation in the program headers.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|