<div dir="ltr">Mike, Jennifer,<div><br></div><div>Thanks for the illustration Mike--I understood what you did--but it does not accomplish what I'm after. However, it does give me some ideas for trying something else that may be suitable for automation.</div><div><br></div><div>Jennifer, you said user-provided 'set clip' commands...do work as expected with 'draw'. As I mentioned earlier, I have not yet seen an example of its use (not in Doc Index either). Could you please provide a simple sample that illustrates how to use it with 'draw'? I think the example that Mike provided was an alternate to using 'clips'. Perhaps I simply misunderstood its intended use.</div><div><br></div><div>Stephen Mc</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 3:54 PM, Jennifer M Adams <span dir="ltr"><<a href="mailto:jadams21@gmu.edu" target="_blank">jadams21@gmu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I looked at the source code, and it’s true that the user-provided ‘set clip’ commands are always overridden with ‘display’, but as Mike F. pointed out, they do work as expected with ‘draw'. I will put this is my list of bugs, but in the meanwhile Mike’s suggestion to draw a few more rectangles on top of your graphic is a good workaround. —Jennifer<br>
<span class=""><br>
On May 30, 2017, at 1:54 PM, Mike Fiorino - NOAA Federal <<a href="mailto:michael.fiorino@noaa.gov">michael.fiorino@noaa.gov</a>> wrote:<br>
<br>
> hi Steve,<br>
><br>
</span><span class="">> now I understand... you'll have to do the clipping by hand using:<br>
><br>
> 'draw recf xlo xhi ylo yhi'<br>
><br>
> which fills in a rectangle set by xlo .. to the current 'line' color<br>
><br>
> here's an example of clipping to a block from x=2.0 to 6.0 and y = 3.0 to 6.0<br>
><br>
> first display something:<br>
><br>
> 'd psl*0.01'<br>
><br>
> then get the dimensions of the plotting area<br>
><br>
> 'q gxinfo'<br>
><br>
> Last Graphic = Contour<br>
> Page Size = 11 by 8.5<br>
> X Limits = 0.5 to 10.5<br>
> Y Limits = 1.25 to 7.25<br>
> Xaxis = Lon Yaxis = Lat<br>
> Mproj = 2<br>
><br>
> then:<br>
><br>
> 'draw recf 0.5 10.5 1.25 3.0' # xlo for plot is 0.5 and xhi is 10.5<br>
> 'draw recf 6.0 3.00 10.5 7.25' # ylo for plot is 1.25 and xhi is 7.25 -- this is the default parea<br>
> 'draw recf 0.5 3.00 2.00 7.25'<br>
> 'draw recf 2.0 6.00 6.00 7.25'<br>
><br>
> # -- draw a box<br>
> 'set line 1 0<br>
> 'draw rec 2.0 3.0 6.0 6.0'<br>
><br>
> here's the plot (ecmwf sea level pressure for 2017052800 analysis -- note the tropical cyclone in the Bay of Bengal (02B)):<br>
><br>
</span>> <bbknhkmnngojjgok.png><br>
<span class="">><br>
> hope this helps...<br>
><br>
> best /R Mike<br>
><br>
> On 5/25/17 3:32 PM, Stephen McMillan wrote:<br>
>> Mike,<br>
>><br>
>> Thanks for the response, but I don't think you understood what I'm trying to accomplish.<br>
>><br>
>> Imagine you've displayed a variable, using the default plot area, and it displays across most of North America. Now, let's say you want to display the same variable, but only including part of the western US, indicated by the dashed rectangle in attached image. What I want to do is display the zoomed-in area but fill the screen to the default plot area, not just that part of the screen.<br>
>><br>
>> If I use 'set parea...' as you suggest, e.g., 'set parea 2.07 3.44 5.35 6.11' I then get the third image shown. It displays the entirety of the original plot, not the zoomed-in area.<br>
>><br>
>> I've tried using 'set clip...' with a draw command, but no luck. Could you send a simple code example to illustrate? I have yet to see how it's used--the Doc Index doesn't help in that regard.<br>
>><br>
>> Steve Mc<br>
>><br>
</span>>> <image.png><br>
>><br>
>> <image.png><br>
>><br>
>> <image.png><br>
<div><div class="h5">>><br>
>> On Wed, May 24, 2017 at 5:52 PM, Mike Fiorino - NOAA Federal <<a href="mailto:michael.fiorino@noaa.gov">michael.fiorino@noaa.gov</a>> wrote:<br>
>> hi Steve,<br>
>><br>
>> I only use 'set clip' for 'draw' commands and it does work, but apparently not for 'display' (took a quick look at the source code and it wasn't obvious why it wouldn't for 'display' except that 'set clip' works at the very low level plot commands)<br>
>><br>
>> have you tried the 'parea' command? this sets the plot area, e.g.,<br>
>><br>
>> 'set parea 1 6 3 7'<br>
>> 'd air'<br>
>><br>
>> note that the labels are outside the parea...<br>
>><br>
>> best /R Mike<br>
>><br>
>><br>
>> On 5/24/17 7:36 PM, Stephen McMillan wrote:<br>
>>> Is the 'set clip' command disabled in GrADS? I can't get it to work per the Documentation Index instructions. A search of the User Forum yields no help, but one entry does suggest that it may indeed be disabled without modifying the code.<br>
>>><br>
>>> For example (file open with variable "air"):<br>
>>><br>
>>> 'set clip 1 6 3 7'<br>
>>> 'd air'<br>
>>><br>
>>> Result is a map displayed to the default plot area, not to the "clip" area. I would normally use 'set mpvals' but cannot get that to work the way I want it, either.<br>
>>><br>
>>> I am using v2,1,a2,iga,1 on a Windows 10 PC. I also cannot get it to work using v2.0.2.oga.2 on a Linux.<br>
>>><br>
>>> I don't need suggestions on how to crop images outside GrADS. I know how to do that.<br>
>>><br>
>>> Stephen McMillan<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> ______________________________<br>
>>> _________________<br>
>>> gradsusr mailing list<br>
>>><br>
>>> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
>>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
>><br>
>><br>
><br>
> ______________________________<wbr>_________________<br>
> gradsusr mailing list<br>
> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br>
</div></div>--<br>
Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
</div></div></blockquote></div><br></div>