Overplot grid [message #86428] |
Thu, 07 November 2013 11:00  |
Jordan Guerra
Messages: 5 Registered: August 2012
|
Junior Member |
|
|
Hello everyone.
Let us say I have an image and I divide that image in a 100x100 square pieces of the same size. How can I overplot a a grid to this image in which I highlight an specific subfield? I mean, if I have some other plot that I calculated from the subfield (X,Y) and I want to be able to locale and frame that and only that location in the whole image, so I can see any particular feature within this rectangle.
Any idea?
Many thanks.
|
|
|
Re: Overplot grid [message #86429 is a reply to message #86428] |
Thu, 07 November 2013 11:20   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jordan Guerra writes:
> Let us say I have an image and I divide that image in a 100x100 square
pieces of the same size. How can I overplot a a grid to this image in
which I highlight an specific subfield? I mean, if I have some other
plot that I calculated from the subfield (X,Y) and I want to be able to
locale and frame that and only that location in the whole image, so I
can see any particular feature within this rectangle.
>
> Any idea?
Here is a grid cell overlayed with a gray-scale transparency to call
attention to it. You can change the value of the Transparent keyword
to make it more or less prominent:
image = Congrid(cgDemoData(18), 50, 50)
cgDisplay, 500, 500
cgLoadCT, 4, /Brewer, /Reverse
cgImage, image, XRange=[0,10], YRange=[0,10], /Save
FOR j=1,9 DO cgPlotS, [0,10], [j,j], Color='Navy'
FOR j=1,9 DO cgPlotS, [j,j], [0,10], Color='Navy'
cgImage, image[35:39,25:29], XRange=[7,8], YRange=[5,6], /Overplot, $
Transparent=25, CTIndex=0
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Overplot grid [message #86431 is a reply to message #86429] |
Thu, 07 November 2013 11:35  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
>
> Jordan Guerra writes:
>
>> Let us say I have an image and I divide that image in a 100x100 square
> pieces of the same size. How can I overplot a a grid to this image in
> which I highlight an specific subfield? I mean, if I have some other
> plot that I calculated from the subfield (X,Y) and I want to be able to
> locale and frame that and only that location in the whole image, so I
> can see any particular feature within this rectangle.
>>
>> Any idea?
>
> Here is a grid cell overlayed with a gray-scale transparency to call
> attention to it. You can change the value of the Transparent keyword
> to make it more or less prominent:
>
> image = Congrid(cgDemoData(18), 50, 50)
> cgDisplay, 500, 500
> cgLoadCT, 4, /Brewer, /Reverse
> cgImage, image, XRange=[0,10], YRange=[0,10], /Save
> FOR j=1,9 DO cgPlotS, [0,10], [j,j], Color='Navy'
> FOR j=1,9 DO cgPlotS, [j,j], [0,10], Color='Navy'
> cgImage, image[35:39,25:29], XRange=[7,8], YRange=[5,6], /Overplot, $
> Transparent=25, CTIndex=0
> END
Maybe this is easier to see what we are doing:
image = Congrid(cgDemoData(13), 500, 500)
cgDisplay, 500, 500
cgLoadCT, 0
cgImage, image, XRange=[0,10], YRange=[0,10], /Save
FOR j=1,9 DO cgPlotS, [0,10], [j,j], Color='Khaki'
FOR j=1,9 DO cgPlotS, [j,j], [0,10], Color='Khaki'
cgImage, image[350:399,250:299], XRange=[7,8], YRange=[5,6],$
/Overplot, Transparent=70, CTIndex=33
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|