Re: draw polylines in panel?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 05 2012 - 08:43:25 MST

In order to draw lines and text on plots that are to be paneled later, you need to use gsn_add_polyline and gsn_add_text.

See example panel_25.ncl at:

http://www.ncl.ucar.edu/Applications/panel.shtml

The gsn_add_xxxx functions have the exact same arguments as the gsn_xxxx procedures; they are functions so you have to make sure they return unique variables.

Also, the gsn_add_xxxx calls just attach the lines and text. You won't see anything until you actually draw the plots again. So, you want to make sure to do these
calls after you create the plots, but before you panel them.

panel_25.ncl above shows how to do this.

--Mary

> lres = True
> lres@gsLineDashPattern = 2
> lres@gsLineThicknessF = 3.0
> xx1 = (/18.5,36.5,36.5,18.5,18.5/)
> yy1 = (/ 5, 5,75,75, 5/)
> lres@gsLineColor = 3
> dum1 = gsn_add_polyline(wks_cl,plot_cl(0), xx1, yy1, lres)
> xx2 = (/22.5,22.5/)
> yy2 = (/75, 5/)
> dum2 = gsn_add_polyline(wks_cl,plot_cl(0), xx2, yy2, lres)
> xx3 = (/26.5,26.5/)
> yy3 = (/75, 5/)
> dum3 = gsn_add_polyline(wks_cl,plot_cl(0), xx3, yy3, lres)
>
> tres = True
> tres@txFontHeightF = 0.015
> tres@txFontThicknessF = 4.0
>
> tres@txFontColor = 3
> dum4 = gsn_add_text(wks_cl,plot_cl(0),"A",20.5,50,tres)
> dum5 = gsn_add_text(wks_cl,plot_cl(0),"B",24.5,60,tres)
> dum6 = gsn_add_text(wks_cl,plot_cl(0),"C",31.5,66,tres)
>

On Nov 4, 2012, at 9:57 PM, astroqing wrote:

> Hi,
> I want to draw some additional polylines and some description words in ecah plots in a panel, and each plot has different ploylines and decription words.
> I tried with the sentence as follows, but it failed. It didn't draw the ploylines in the plot i want to draw, but it draw outside the plot. Could you help me and tell me how to solve the problem?
> lres = True
> lres@gsLineDashPattern = 2
> lres@gsLineThicknessF = 3.0
> xx1 = (/18.5,36.5,36.5,18.5,18.5/)
> yy1 = (/ 5, 5,75,75, 5/)
> lres@gsLineColor = 3
> gsn_polyline(wks_cl,plot_cl(0), xx1, yy1, lres)
> xx2 = (/22.5,22.5/)
> yy2 = (/75, 5/)
> gsn_polyline(wks_cl,plot_cl(0), xx2, yy2, lres)
> xx3 = (/26.5,26.5/)
> yy3 = (/75, 5/)
> gsn_polyline(wks_cl,plot_cl(0), xx3, yy3, lres)
>
> tres = True
> tres@txFontHeightF = 0.015
> tres@txFontThicknessF = 4.0
>
> tres@txFontColor = 3
> gsn_text(wks_cl,plot_cl(0),"A",20.5,50,tres)
> gsn_text(wks_cl,plot_cl(0),"B",24.5,60,tres)
> gsn_text(wks_cl,plot_cl(0),"C",31.5,66,tres)
>
>
>
> 2012-11-03
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 5 08:43:39 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 06 2012 - 15:05:49 MST