A grid is overlaid on an image [message #88819] |
Tue, 24 June 2014 02:36  |
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   |
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 #88833 is a reply to message #88831] |
Tue, 24 June 2014 12:13   |
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   |
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 #88841 is a reply to message #88840] |
Wed, 25 June 2014 03:43   |
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
|
|
|
|