# Re: simple plot

Date: Fri, 24 Feb 2006 10:57:58 -0700

Hi Roni,

You can input 2 lines into gsn_xy by inputting the x and y arrays with
dimensions (2,ntim). For instance:

x = new((/2,21/),"float") ; add cyclic pt
y = x
x(0,:19) = a(:19,0)
x(1,:19) = a(20:,0)
y(0,:19) = a(:19,1)
y(1,:19) = a(20:,0)

x(0,20) = x(0,0) ; add cyclic pt.
x(1,20) = x(1,0)
y(0,20) = y(0,0)
y(1,20) = y(1,0)

Notice I created new arrays x,y with sizes(2,21), so as to add a cyclic
point so that the circle completes itself.

To fill your circle, take a look at:

You should be able to pass in the same x,y arrays described above into
gsn_add_polygon, but don't forget to not advance the frame in the gsn_xy
plot call (res@gsnFrame = False)... After you call gsn_add_polygon, call
frame: frame(wks)
Good luck!

rravia_at_po-box.mcgill.ca wrote:
> Hi,
> I have an ascii file with two columns (say x and y).
> There are, say, 20 rows, then an empty row, and then another 20 rows.
>
> The first 20 rows represent points of circle 1 and the next 20 rows,
> points of circle 2.
>
> When I plot it with gsn_xy, how do I tell NCL to treat the next 20 rows
> (the rows after the empty line) as a different line (so it won't connect
> the last point of circle 1 with the first point of circle 2)?
>
> Also, is there a way to tell NCL to connect the first point of circle 1
> with the last point of circle 1?
>
> Last question is whether I can fill the circle with a color?
>
> Thanks!
> Roni
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
--------------------------------------------------------------