<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<font face="Osaka">Here are some commands and an image that illustrate how ‘set clip’ works with ‘draw’: </font>
<div><span style="font-size: 14px; font-family: 'Courier New';">ga-> c </span></div>
<div><font face="Courier New" style="font-size: 14px;">ga-> set line 2<br>
</font>
<div><font face="Courier New" style="font-size: 14px;">ga-> set clip 4 5 1 2<br>
ga-> draw recf 0 0 11 8.5</font>
<div><font face="Courier New"><span style="font-size: 14px;">ga-> gxprint tmp.png<br>
</span></font>
<div><br>
</div>
<div><img height="618" width="800" apple-width="yes" apple-height="yes" apple-inline="yes" id="985643C7-DB39-47FE-8C97-751D68E2832E" src="cid:E160AABD-E5BA-47CF-B5BA-5580545458D4"></div>
<div><br>
</div>
<div>—Jennifer</div>
<div><br>
<br>
<br>
<br>
<div>On May 30, 2017, at 4:30 PM, Stephen McMillan <<a href="mailto:smcmillan@planalytics.com">smcmillan@planalytics.com</a>> wrote:<br>
<br>
<blockquote type="cite">Mike, Jennifer,<br>
<br>
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.<br>
<br>
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.<br>
<br>
Stephen Mc<br>
<br>
On Tue, May 30, 2017 at 3:54 PM, Jennifer M Adams <<a href="mailto:jadams21@gmu.edu">jadams21@gmu.edu</a>> wrote:<br>
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>
<br>
On May 30, 2017, at 1:54 PM, Mike Fiorino - NOAA Federal <michael.fiorino@noaa.gov> wrote:<br>
<br>
> hi Steve,<br>
><br>
> 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>
> <bbknhkmnngojjgok.png><br>
><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>
>> <image.png><br>
>><br>
>> <image.png><br>
>><br>
>> <image.png><br>
>><br>
>> On Wed, May 24, 2017 at 5:52 PM, Mike Fiorino - NOAA Federal <michael.fiorino@noaa.gov> 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>
>>> gradsusr@gradsusr.org<br>
>>> http://gradsusr.org/mailman/listinfo/gradsusr<br>
>><br>
>><br>
><br>
> _______________________________________________<br>
> gradsusr mailing list<br>
> gradsusr@gradsusr.org<br>
> http://gradsusr.org/mailman/listinfo/gradsusr<br>
<br>
--<br>
Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
gradsusr@gradsusr.org<br>
http://gradsusr.org/mailman/listinfo/gradsusr<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
gradsusr@gradsusr.org<br>
http://gradsusr.org/mailman/listinfo/gradsusr<br>
</blockquote>
<br>
<div>--<br>
Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>