comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » overplotting contours on tvimage....
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: overplotting contours on tvimage.... [message #94398 is a reply to message #94393] Tue, 09 May 2017 04:44 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 05/08/2017 09:50 PM, M Q wrote:
> I'm trying to overplot contour lines on an image made with David Fanning's TVIMAGE command.
>
> I'm doing something like this:
>
>
> data=world() ;360x360 array, ranges from 0 to 254
> tvimage,data,position=[.5,.5,.6,.6] ; I need to do multiple plots
>
> contour,/overplot,data,levels =[ 100,150,200]
>
> No contours show up.
>
> I've thought about doing a congrid command something like this:
>
> data2 = congrid(data,x_panel_size, y_panel_size)
> contour,data2,/overplot,levels =[100,150,200]
>
> but I can't figure out how to get the size of the current plot, that is, the image I plotted at position= [.5,.5,.6,.6].
>
>
> Any suggestions would be welcome. I've been banging my head against the wall for a couple of days now.
Use

contour,data, path_info=info, path_xy=lines, /path_data_coord, $
levels=[100,150,200]
print, info, /implied
print, lines

to check, whether the contours are as you expect.

I'm not familiar with the tvimage command, but to properly align the
contours and the image, consider manually setting the window size then
using device coordinates to draw the contours.

xwsize=1200
ywsize=1200
imagePos=[.5,.5,.6,.6]
window, xs=xwsize, ys=ywsize
tvimage, data, position=imagePos

foreach ii,info do plots, $
imagePos[0]*xwsize +lines[0,ii.offset+lindgen(ii.n)]* $
((imagePos[2]-imagePos[0])/360*xwsize), $
imagePos[1]*ywsize +lines[1,ii.offset+lindgen(ii.n)]* $
((imagePos[3]-imagePos[1])/360*xwsize), $
/device

I hope this helps, Markus
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: area threshold
Next Topic: Convert string to image matrix (like xyouts)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 14:31:38 PST 2025

Total time taken to generate the page: 0.24240 seconds