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

Home » Public Forums » archive » Re: How to Insert Small Image Into plot
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: How to Insert Small Image Into plot [message #61870 is a reply to message #61868] Wed, 06 August 2008 11:41 Go to previous messageGo to previous message
Juggernaut is currently offline  Juggernaut
Messages: 83
Registered: June 2008
Member
On Aug 6, 2:02 pm, Marshall Perrin <mper...@bantha.org> wrote:
> herbert.asy...@gmail.com <herbert.asy...@gmail.com> wrote:
>> Hi,
>> I'm pretty new to IDL.
>> I have managed to write some routines to generate some plots and
>> output them as pngs, but I would like to place a small image
>> (png,jpg,bmp whatever) in one corner of the plot.
>> I would appreciate any suggestions/pointers on how to go about this.
>> Thank you
>
> Read up on the !P.POSITION variable, which lets you control the output
> location of a plot. You'll probably want to use either David Fanning's
> TVIMAGE.PRO or Liam Gumley's IMDISP.PRO to display the actual image.
>
> - Marshall

Simple answer is.....
;- Create some x, y data to plot
x = indgen(100)
y = x*x
;- Create some image from random numbers
image = randomu(3, 100,100)
;- Get the dimensions of the image
sz = size(image, /dimensions)
;- Set the size of the window you'd like
windowXsize = 500
windowYsize = 500
window, /free, xsize=windowXsize, ysize=windowYsize
plot, x, y
;- Top Right Corner
tv, image, windowXsize-sz[0], windowYsize-sz[1]
;- Bottom Left Corner
tv, image, 0, 0
;- Top Left Corner
tv, image, 0, windowYsize-sz[1]
;- Bottom Right Corner
tv, image, windowXsize-sz[0], 0

Essentially the syntax is...
tv, image, X Position, Y Position
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Own a small business you want people to know about? Got a service you can offer? or got something to sell?
Next Topic: Re: Finding the Top Two Most Common Coordinates in a Multi-Dimensional Array

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

Current Time: Thu Oct 09 20:55:37 PDT 2025

Total time taken to generate the page: 0.96157 seconds