<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5803" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN 
class=903405401-20092009>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=903405401-20092009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009>Sorry for the 
bother. A R problem looks for your suggestion.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=903405401-20092009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009>I want to draw a figure with filled contour in an 
irregular map. </SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009>But I found that the contours overlap the boundaries of 
the map, and also some regions in the map were not 
filled.</SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009>I used the following R 
code:</SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial><SPAN class=258354605-19092009><FONT 
size=2>&nbsp;&nbsp;&nbsp; </FONT>
<DIV><SPAN class=258354605-19092009><FONT 
face=Cambria>Map&lt;-readShapeSpatial("data1")<SPAN class=903405401-20092009> # 
data1, a shapefile, the whole Australian map with 
boundary.</SPAN></FONT></SPAN></DIV>
<DIV><FONT face=Cambria><SPAN 
class=258354605-19092009>plot(Map)</SPAN></FONT></DIV>
<DIV><SPAN class=258354605-19092009><FONT 
face=Cambria>data2.li&lt;-interp(data2$x,data2$y,data2$z)<SPAN 
class=903405401-20092009> #data2, txt file with three columns: x, longitude; y, 
latitude; z, variable (e.g., rainfall)</SPAN></FONT></SPAN></DIV>
<DIV><FONT face=Cambria><SPAN class=258354605-19092009>filled.contour(data2.li, 
color=topo.colors, add=TRUE)</SPAN></FONT></DIV>
<DIV><FONT face=Cambria size=2><SPAN 
class=258354605-19092009></SPAN></FONT>&nbsp;</DIV></SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009>Are there any R functions can be used to limit the 
filled contours just inside the map (no overlap and&nbsp;no 
blank)?</SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009>Do you have any ideas to deal with this problem? Thanks 
very much for that!</SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009>Best,</SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=903405401-20092009><SPAN 
class=258354605-19092009><FONT face=Arial size=2><SPAN 
class=258354605-19092009></SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial 
size=2></FONT>&nbsp;</DIV>
<STYLE>
st1\:*{behavior:url(#ieooui) }
</STYLE>

<STYLE>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-alt:\5B8B\4F53;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:SimSun;}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:35.4pt;
        mso-footer-margin:35.4pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</STYLE>

<DIV class=Section1>
<P class=MsoNormal><SPAN style="COLOR: #3366ff">Zhongkui <SPAN 
class=SpellE>Luo</SPAN></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #3366ff"><SPAN class=SpellE><SPAN 
class=903405401-20092009>PhD candidate</SPAN></SPAN></SPAN></P>
<P class=MsoNormal><?xml:namespace prefix = st1 ns = 
"urn:schemas-microsoft-com:office:smarttags" /><st1:PlaceName w:st="on"><SPAN 
class=GramE><SPAN 
style="COLOR: #3366ff">CSIRO</SPAN></SPAN></st1:PlaceName><SPAN 
class=GramE><SPAN style="COLOR: #3366ff"> <st1:PlaceType 
w:st="on">Land</st1:PlaceType> &amp; Water, <st1:City w:st="on"><st1:place 
w:st="on">Butler</st1:place></st1:City> Lab.</SPAN></SPAN><SPAN 
style="COLOR: #3366ff"><?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal><st1:address w:st="on"><st1:Street w:st="on"><SPAN 
class=SpellE><SPAN style="COLOR: #3366ff">Clunies</SPAN></SPAN><SPAN 
style="COLOR: #3366ff"> Ross Street</SPAN></st1:Street><SPAN 
style="COLOR: #3366ff">, <st1:City 
w:st="on">Acton</st1:City></SPAN></st1:address><SPAN 
style="COLOR: #3366ff"><o:p></o:p></SPAN></P>
<P class=MsoNormal><st1:City w:st="on"><SPAN 
style="COLOR: #3366ff">Canberra</SPAN></st1:City><SPAN style="COLOR: #3366ff">, 
ACT 2601, <st1:country-region w:st="on"><st1:place 
w:st="on">Australia</st1:place></st1:country-region><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #3366ff">Ph: +61 2 6246 <SPAN 
class=GramE>5594<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN 
class=SpellE>E</SPAN></SPAN><SPAN class=SpellE>_Mail</SPAN>: 
Zhongkui.luo@csiro.au<o:p></o:p></SPAN></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>&nbsp;</P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>