[ncl-talk] how to locate one table in the same frame with one plot

Mary Haley haley at ucar.edu
Sun Jul 24 23:17:39 MDT 2016


Dear Yi Lu,

"gsn_table" is a procedure, not a function and it doesn't return a plot
object because it doesn't create a singe plot object.  Instead, it's just a
series of calls to draw text and filled cells on the workstation.

The "overlay" procedure is meant to be used for plots that share the same
data space. Since gsn_table doesn't really have the concept of a data space
(i.e, an X and Y axis), you can't overlay it on another plot object.

I suggest drawing your table using gsn_csm_blank_plot instead, and this way
the table will have an X and a Y axis.

See the table examples at:

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

and in particular look at examples table_4.ncl and table_6.ncl.

--Mary


On Sun, Jul 24, 2016 at 8:05 AM, 易路 <dg1225033 at smail.nju.edu.cn> wrote:

> Hi all,
>
> I used the functions of gsn_csm_contour_map and gsn_table to form a plot
> and a table. To puting them in one frame, I tried to use the function of
> overlay, but when I set plot2=gsn_table(......), overlay(plot1,plot2),
> frame(wks), it showed errors of "fatal:syntax error: line 121 in file
> ts_picture.ncl before or near gsn_table". Will you please check the problem
> for me? Thanks to all!
>
> the related script are as follows, and the whole script is uploaded to the
> attachment
>
> ;;;;;;;;;;high related script ;;;;;;;;;;;;;;;;;;
> plot=gsn_csm_contour_map(wks,Ts,res)
> ;set the table
> ncr  =(/2,5/)
> x    =(/0.1,0.6/)
> y    =(/0.1,0.2/)
> text =(/ (/"BIAS","FAR","POD","POFD","HSS"/),\
>          (/"0","0","0","0","0"/)/)
> restbl =True
> restbl at txFontHeightF =0.03
> restbl at gsFillColor   ="transparent"
> gsn_table(wks,ncr,x,y,text,restbl)
>
> frame(wks)
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Sincerely,
> Yi Lu
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160724/dcb5aa5e/attachment.html 


More information about the ncl-talk mailing list