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

易路 dg1225033 at smail.nju.edu.cn
Tue Jul 26 19:19:13 MDT 2016


Dear Mary,

I tried to use gsn_csm_blank_plot to draw the table whic I wanted to attach it under the map plot, but the table was still shown in an other new frame.

When I use overlay to put the map plot and tabel together, the showed the error "fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member".

Maybe, I can only use the gsn_csm_blank_plot to show my data as displayed in the examples of table_4.ncl and table_6.ncl, but I need to show the geographical information of the map, so I had to use the gsn_csm_contour_map to generat the first plot.

So, would you please check the problems for me, why the tabel generated by gsn_csm_blank_plot can't be located uder the plot generated by gsn_csm_cntour_map.

The input file, script and the output png files have been uploaded to the accessary. Thanks very much for your precious time and attention !

Yi Lu

 






易路

南大邮件系统/学生/博士生/12级博士生

南京市汉口路22号 




 
 
 
------------------ Original ------------------
From:  "Mary Haley"<haley at ucar.edu>;
Date:  Mon, Jul 25, 2016 01:17 PM
To:  "易路"<dg1225033 at smail.nju.edu.cn>; 
Cc:  "ncl-talk"<ncl-talk at ucar.edu>; 
Subject:  Re: [ncl-talk] how to locate one table in the same frame with one plot

 
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/20160727/f3d92b5e/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ts_matrix.txt
Type: application/octet-stream
Size: 7030 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160727/f3d92b5e/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts_picture.ncl
Type: application/octet-stream
Size: 4573 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160727/f3d92b5e/attachment-0005.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ts_results.000001.png
Type: application/octet-stream
Size: 60861 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160727/f3d92b5e/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ts_results.000002.png
Type: application/octet-stream
Size: 20754 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160727/f3d92b5e/attachment-0007.obj 


More information about the ncl-talk mailing list