|
Re: How to Insert Small Image Into plot [message #61868 is a reply to message #61867] |
Thu, 07 August 2008 00:09  |
herbert.asylum
Messages: 3 Registered: August 2008
|
Junior Member |
|
|
Thank you for the various responses.
I am going to look at these and see if they resolve my question or
point me in the right direction.
At this point I'm not sure if they will or not.
It may be that I phrased my question incorrectly or that I don't yet
understand enough to realise that they do provide an answer.
Just to clarify in case I phrased it wrongly.
I create a graph showing some data in IDL and then save it as a png
file which works just fine.
image = TVRD(true = 1)
WRITE_PNG, 'path\filename.png', image
I would like to place a small logo (of the lab producing the data)
which I have currently also in png form (although if required
obviously I can convert it) on this graph in one corner.
It may well be that I have already been given the answer on how to do
this once I read through the pointers already given.
thanks again for all help. =o)
|
|
|
Re: How to Insert Small Image Into plot [message #61870 is a reply to message #61868] |
Wed, 06 August 2008 11:41  |
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
|
|
|
Re: How to Insert Small Image Into plot [message #61871 is a reply to message #61870] |
Wed, 06 August 2008 11:02  |
Marshall Perrin
Messages: 44 Registered: December 2005
|
Member |
|
|
herbert.asylum@gmail.com <herbert.asylum@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
|
|
|
Re: How to Insert Small Image Into plot [message #61872 is a reply to message #61871] |
Wed, 06 August 2008 06:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
herbert.asylum@gmail.com writes:
> 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.
The TV command usually works. :-)
Cheers,
David
P.S. What have you tried?
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|