# [gradsusr] draw poly

Jeff Duda jeffduda319 at gmail.com
Thu Mar 1 19:20:58 EST 2018

```Thanks, Stephen! It did work.

That needs to be added to the documentation for the 'draw line' or 'draw
polyf' functions. It's not there, so no one would know of this
functionality without being told.

Jeff

On Thu, Mar 1, 2018 at 4:00 PM, Stephen McMillan <smcmillan at planalytics.com>
wrote:

> Jeff,
>
> It's actually pretty simple.  Just substitute "line" for "polyf" in the
> command.  For example:
>
> 'draw polyf x1 y1 x2 y2 x3 y3 x4 y4 x1 y1' will draw a filled polygon
> 'draw line x1 y1 x2 y2 x3 y3 x4 y4 x1 y1' will draw an unfilled polygon
>
> You control the line color same as for polyf.  If you want to draw a
> filled polygon with a border of different color, then just do the 'draw
> polyf...' followed by the 'draw line...' but with a different color.
>
> Hope this helps.
> Stephen McMillan
>
>
>
> On Thu, Mar 1, 2018 at 5:49 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> I guess. I was just hoping there was a built-in function to do this so
>> that I wouldn't have to iterate 'draw line' n times just to draw an
>> unfilled n-gon. There are 'draw rec' and 'draw recf' functions, so I
>> figured it would make sense if there was a 'draw poly' function to
>> correspond to 'draw polyf' in the same manner. Thank you for the response,
>> though.
>>
>> Jeff
>>
>> On Thu, Mar 1, 2018 at 3:31 PM, David Nielsen <davidnielsen at id.uff.br>
>> wrote:
>>
>>> Jeff,
>>>
>>> You can make a function like the following to draw lines to make a
>>> polygon. In this case, (ir)regular 4-side polygons. Is this what you meant?
>>>
>>>
>>> ******************* This funtion draws a box
>>> * Usage:
>>> * ddbox lat1 lat2 lat3 lat4 lon1 lon2 lon3 lon4
>>>
>>> function ddbox(arg)
>>>
>>> lat1=subwrd(arg,1)
>>> lat2=subwrd(arg,2)
>>> lat3=subwrd(arg,3)
>>> lat4=subwrd(arg,4)
>>> lon1=subwrd(arg,5)
>>> lon2=subwrd(arg,6)
>>> lon3=subwrd(arg,7)
>>> lon4=subwrd(arg,8)
>>>
>>> 'set line 1 1 12'
>>>
>>> 'q w2xy 'lon1' 'lat1
>>> x1=subwrd(result,3)
>>> y1=subwrd(result,6)
>>>
>>> 'q w2xy 'lon2' 'lat2
>>> x2=subwrd(result,3)
>>> y2=subwrd(result,6)
>>>
>>> 'q w2xy 'lon3' 'lat3
>>> x3=subwrd(result,3)
>>> y3=subwrd(result,6)
>>>
>>> 'q w2xy 'lon4' 'lat4
>>> x4=subwrd(result,3)
>>> y4=subwrd(result,6)
>>>
>>> 'draw line 'x1' 'y1' 'x2' 'y2
>>> 'draw line 'x2' 'y2' 'x3' 'y3
>>> 'draw line 'x3' 'y3' 'x4' 'y4
>>> 'draw line 'x4' 'y4' 'x1' 'y1
>>>
>>> return
>>>
>>>
>>>
>>> 2018-03-01 19:13 GMT-03:00 Jeff Duda <jeffduda319 at gmail.com>:
>>>
>>>> Is there a version of the draw polyf function to draw an unfilled
>>>> polygon?
>>>>
>>>> Jeff Duda
>>>>
>>>> --
>>>> Jeff Duda, Research Scientist
>>>>
>>>> University of Colorado Boulder
>>>>
>>>> Cooperative Institute for Research in Environmental Sciences
>>>>
>>>> NOAA/OAR/ESRL/Global Systems Division
>>>> Boulder, CO
>>>>
>>>> _______________________________________________
>>>> gradsusr mailing list
>>>>
>>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>>
>>>
>>
>>
>> --
>> Jeff Duda, Research Scientist
>>
>> University of Colorado Boulder
>>
>> Cooperative Institute for Research in Environmental Sciences
>>
>> NOAA/OAR/ESRL/Global Systems Division
>> Boulder, CO
>>
>> _______________________________________________
>> gradsusr mailing list
>>
>>
>
> _______________________________________________
> gradsusr mailing list
>
>

--
Jeff Duda, Research Scientist

University of Colorado Boulder

Cooperative Institute for Research in Environmental Sciences

NOAA/OAR/ESRL/Global Systems Division
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...