Re: expanded area is shown when trying to plot an image on a map [message #78124] |
Wed, 26 October 2011 21:37 |
Zhang Bo
Messages: 22 Registered: October 2011
|
Junior Member |
|
|
On Oct 26, 7:51 pm, David Fanning <n...@dfanning.com> wrote:
> Zhang Bo writes:
>> Thanks, again! David. Coyote Library fixes problem as usually.
>
>> I was hesitated to use Coyote Library when the build-in function
>> works, but it seems it's better to be familiar with it as earlier as
>> better.
>
> You know, most of these graphics problems have been
> solved now. I really don't understand people who
> insist on working with brain-dead IDL commands
> like TV and Contour. But, I guess some people just
> enjoy the pain. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
I learn IDL mostly by reading pros from old people who work in my
field. So I got the idea kind of out of date. I wish I had somebody
could tell me this when I started IDL.
|
|
|
Re: expanded area is shown when trying to plot an image on a map [message #78128 is a reply to message #78124] |
Wed, 26 October 2011 16:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Zhang Bo writes:
> Thanks, again! David. Coyote Library fixes problem as usually.
>
> I was hesitated to use Coyote Library when the build-in function
> works, but it seems it's better to be familiar with it as earlier as
> better.
You know, most of these graphics problems have been
solved now. I really don't understand people who
insist on working with brain-dead IDL commands
like TV and Contour. But, I guess some people just
enjoy the pain. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: expanded area is shown when trying to plot an image on a map [message #78129 is a reply to message #78128] |
Wed, 26 October 2011 16:16  |
Zhang Bo
Messages: 22 Registered: October 2011
|
Junior Member |
|
|
On Oct 26, 6:40 pm, David Fanning <n...@dfanning.com> wrote:
> Zhang Bo writes:
>> I have a north hemisphere 2D consentration array. 360*90
>> I set up a map
>> map_set, /mercator, 0, -50, limit = [ymin, xmin, ymax, xmax], $
>> color = cgcolor('black'), $
>> position = [xregion(0), yreg_bot(0), xregion(1), yreg_bot(1)], $
>> charsize = 1, /noerase
>
>> I warp the image
>> new_img = map_image(img, startx,starty,/BILINEAR, /WHOLE_MAP, $
>> latmin = 1, latmax = 90, lonmin = -179, $
>> lonmax = 180, compress = 1)
>
>> and then I show the image
>> TV, new_img, startx,starty
>
>> My problems are:
>> 1 Since I have a color bar to show, I squeeze the map by setting
>> posiont in map_set. However, the img shown by TV does not squeeze.
>> 2 Although I set up start position for TV, data are shown outside the
>> map area and overlap with plot title.
>> Basically I am asking when you have a global data set, how to plot the
>> data any place you want to zoom in and also make sure the data align
>> with the lat-lon postion correctly.
>
> I would say, use Coyote Library routines. :-)
>
> For example, cgImage honors the Position keyword:
>
> cgImage, new_image, $
> Position=[xregion(0), yreg_bot(0), xregion(1), yreg_bot(1)]
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks, again! David. Coyote Library fixes problem as usually.
I was hesitated to use Coyote Library when the build-in function
works, but it seems it's better to be familiar with it as earlier as
better.
|
|
|
Re: expanded area is shown when trying to plot an image on a map [message #78130 is a reply to message #78129] |
Wed, 26 October 2011 15:40  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Zhang Bo writes:
> I have a north hemisphere 2D consentration array. 360*90
> I set up a map
> map_set, /mercator, 0, -50, limit = [ymin, xmin, ymax, xmax], $
> color = cgcolor('black'), $
> position = [xregion(0), yreg_bot(0), xregion(1), yreg_bot(1)], $
> charsize = 1, /noerase
>
> I warp the image
> new_img = map_image(img, startx,starty,/BILINEAR, /WHOLE_MAP, $
> latmin = 1, latmax = 90, lonmin = -179, $
> lonmax = 180, compress = 1)
>
> and then I show the image
> TV, new_img, startx,starty
>
> My problems are:
> 1 Since I have a color bar to show, I squeeze the map by setting
> posiont in map_set. However, the img shown by TV does not squeeze.
> 2 Although I set up start position for TV, data are shown outside the
> map area and overlap with plot title.
> Basically I am asking when you have a global data set, how to plot the
> data any place you want to zoom in and also make sure the data align
> with the lat-lon postion correctly.
I would say, use Coyote Library routines. :-)
For example, cgImage honors the Position keyword:
cgImage, new_image, $
Position=[xregion(0), yreg_bot(0), xregion(1), yreg_bot(1)]
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|