tvimage followed by contour in ps... positioning not coming out right [message #45497] |
Tue, 13 September 2005 12:13  |
Turamarth
Messages: 4 Registered: January 2005
|
Junior Member |
|
|
My question has to do with using tvimage from the programming library
at www.dfanning.com. I am using it to plot an image in a postcript
file and then I use contour - overplotting on top of that image. I am
making multiple plots on one page so I have set the !P.multi variable.
Simply put my code is (I can give the full code if necessary):
set_plot, 'ps'
DEVICE, FILENAME = pathname + 'VelContours.ps', /color,
BITS=8,xsize=7,ysize=10,/inches,$
ENCAPSULATED = 0, /portrait, XOFFSET = 1, YOFFSET = 1
!P.Multi = [0,2,4]
TVSCALE, image, /keep_aspect_ratio, position = get_position
contour, arr, /noerase, position = get_position,c_colors = color, $
level = levelset
Well, as I understood it, this was supposed to overplot a contour
exactly on top of my image. It does not do this, the contour instead
plots with a different aspect ratio then the image, such that the two
sides and bottom all mach up, but the contour is short of the top!
I thought it might have something to do with this line in TVIMAGE:
xsize = (position(2) - position(0)) * !D.X_VSIZE
ysize = (position(3) - position(1)) * !D.Y_VSIZE
xstart = position(0) * !D.X_VSIZE
ystart = position(1) * !D.Y_VSIZE
as the ratio that it was off was exactly (!D.Y_VSIZE/float(
!D.X_VSIZE)). But that is only true for the first image that is
plotted! After the first plot the ratio was different.. although I
have not really looked into THAT much yet.
This all seems very strange to me. Is tvimage supposed to work like I
think it should, or am I using it wrong?
|
|
|
|
Re: tvimage [message #60929 is a reply to message #45497] |
Tue, 24 June 2008 10:48  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
> Hi~ all , has anyone ever use the tvimage procedure wriitten by
> David ?
one or two among us might have... ah ah ah
No, seriously, download the whole Coyote library... you are certainly
missing a few routines required by TVImage
Jean
When I tried to use it . It reminds me that there are errros
> in these two lines:
>
> % Compiled module: TVIMAGE_ERROR.
>
> Erase, Color=FSC_Color(background,BREWER=brewer)
>
> ^
> % Syntax error.
>
> IF Size(acolor, /TNAME) EQ 'STRING' THEN acolor =
> FSC_COLOR(acolor, BREWER=brewer)
>
> ^
>
>
> Thanks~
|
|
|