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

Home » Public Forums » archive » A grid is overlaid on an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
A grid is overlaid on an image [message #88819] Tue, 24 June 2014 02:36 Go to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi

I was trying to plot a grid overlay my image. I found the OVERLAY function but this overlay a contour on an image. Does anyone knows if there is anything available in IDL to plot a grid overlay on the image?

Regards,
Gina
Re: A grid is overlaid on an image [message #88825 is a reply to message #88819] Tue, 24 June 2014 08:30 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Below are two examples using the plot and image functions. If you want to use maps, you might try the MAPGRID keyword (but that is a guess...). You can use the OVERPLOT keyword with Plot() to put it on an image, too.


IDL> p1 = plot(/TEST)
% Loaded DLM: XML.
IDL> (p1.axes)[0] -> SetProperty, TICKLEN=1.0, SUBTICKLEN=0.02
IDL> (p1.axes)[1] -> SetProperty, TICKLEN=1.0, SUBTICKLEN=0.02

IDL> im1 = image(/TEST)
% Loaded DLM: JPEG.
IDL> im1 = image(/test, AXIS_STYLE=2)
IDL> (im1.axes)[0] -> SetProperty, TICKLEN=1.0, SUBTICKLEN=0.02
IDL> (im1.axes)[1] -> SetProperty, TICKLEN=1.0, SUBTICKLEN=0.02
Re: A grid is overlaid on an image [message #88826 is a reply to message #88819] Tue, 24 June 2014 08:59 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I tried to use your example but I got the following error:

% Variable is undefined: PLOT.
Re: A grid is overlaid on an image [message #88827 is a reply to message #88819] Tue, 24 June 2014 09:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> I was trying to plot a grid overlay my image. I found the OVERLAY function but this overlay a contour on an image. Does anyone knows if there is anything available in IDL to plot a grid overlay on the image?

http://www.idlcoyote.com/graphics_tips/grid.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: A grid is overlaid on an image [message #88831 is a reply to message #88819] Tue, 24 June 2014 11:45 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I came across with this link David but in my case I use the cgimage to display the image and the keywords XTicklen, YTicklen etc are not allowed in the cgimage function.
Re: A grid is overlaid on an image [message #88833 is a reply to message #88831] Tue, 24 June 2014 12:13 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Try the AXKEYWORDS keyword

cgImage, cgDemoData(16), XRANGE=[0,227], AXKEYWORDS={xticklen: 1.0, yticklen: 1.0}, POSITION=[0.25, 0.25, 0.75, 0.75], /AXES
Re: A grid is overlaid on an image [message #88834 is a reply to message #88831] Tue, 24 June 2014 12:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

>
> I came across with this link David but in my case I use the cgimage to display the image and the keywords XTicklen, YTicklen etc are not allowed in the cgimage function.

IDL> cgImage, cgDemoData(7), /AXES, AXKeywords={XTicklen:1.0, $
YTickLen:1.0, axiscolor:'navy'}

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: A grid is overlaid on an image [message #88840 is a reply to message #88819] Wed, 25 June 2014 03:15 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
1.The distance between the lines is 100 each. It's possible to minimize this in order to have more squares in the image?

2.Also the axes show a short lines after 10 points each time. It's possible to remove these short lines?

Regards,
Gina
Re: A grid is overlaid on an image [message #88841 is a reply to message #88840] Wed, 25 June 2014 03:43 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, June 25, 2014 12:15:18 PM UTC+2, g.na...@gmail.com wrote:
> 1.The distance between the lines is 100 each. It's possible to minimize this in order to have more squares in the image?
>
>
>
> 2.Also the axes show a short lines after 10 points each time. It's possible to remove these short lines?
>
>
>
> Regards,
>
> Gina

Seems pretty straight forward. From the help of the plot procedure:
http://www.exelisvis.com/docs/PLOT_Procedure.html

cgImage, cgDemoData(7), /AXES, AXKeywords={XTicklen:1.0, YTickLen:1.0, axiscolor:'navy', xminor:1, yminor:1, xtickinterval:60, ytickinterval:40}

If you wish, you may alternatively specify the number of tick intervals instead of the distance between ticks. Then you would have to use the keyword "[xy]ticks".

Cheers,
Helder
Re: A grid is overlaid on an image [message #88845 is a reply to message #88819] Wed, 25 June 2014 05:48 Go to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Thank you very much.

Gina
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How do I place an image when I am using !P.Multi?
Next Topic: Can I interface my fortran program in IDL code?

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

Current Time: Wed Oct 08 11:44:43 PDT 2025

Total time taken to generate the page: 0.00653 seconds