[ncl-talk] Error: gsn plot: All of the plots passed to gsn_panel appear to be invalid

Dennis Shea shea at ucar.edu
Wed Aug 6 18:58:14 MDT 2014


Did you read the gsn_panel documentation?

https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_panel.shtml

In particular,

	procedure gsn_panel (
		wks       : graphic,
		plots [*] : graphic,
		dims  [*] : integer,
		res   [1] : logical
	)
*dims*
An array of integers indicating the configuration of the plots on the
frame.  *dims* can either be two integers representing the
number of rows and columns of the paneled lots ....
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Think

 dims = (/nrow,ncol/)

====

So, all you need is

 pres = True
 pres at gsnMaximize = True

Then

 gsn_panel(wks,plot,(/3,4/),pres)  ; 3 rows; each row having 4 plots

or

 gsn_panel(wks,plot,(/4,3/),pres)  ; 4 rows; each row having 3 plots




On Wed, Aug 6, 2014 at 5:45 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

> Hi,
>
> I am trying to plot 12 plots in one panel. Each column with 4 plots and
> three columns like that. Here is the code, I would be grateful if you could
> tell me where the error is. Thanking you in advance
>  ===========================================
> ;     To plot decadal plots
> ; ===========================================
> ;
> ; Concepts illustrated:
> ;   - Specifying how many plots to draw in each row
> ;   - Left-justifying and centering paneled plots
> ;
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
>
>  ;=============================================
> ; data processing
> ;=============================================
>  x=asciiread("~/Documents/PhD_June_2015/NCL_Moonsoon/Data_output/all_month_decade",(/13,12/),
> "float")
>  year_decadal=ispan(1880,2012,10)
> ;==============================================
> ; create plot
> ;=============================================
>
>
>  wks  = gsn_open_wks ("ps", "panel" )
>  plot = new ( 12 , graphic)
>
>
>  hres                          = True
>  hres at gsnDraw                  = False
>  hres at gsnFrame                 = False
>
>  hres at tiMainString             = "Decadal Mean"
>
>  hres at cnLevelSelectionMode     = "ManualLevels"     ; manual levels
>  hres at cnMinLevelValF           = -10.
>  hres at cnMaxLevelValF           =  10.
>  hres at cnLevelSpacingF          = 2.
>
> ;==============================================
> ; create panel
> ;=============================================
>  pres                 = True
>  pres at gsnPanelRowSpec = True                   ; tell panel what order to
> plt
>  gsn_panel(wks,plot,(/4,4,4/),pres)
>
>  pres at gsnPanelCenter  = False
>  gsn_panel(wks,plot,(/4,4,4/),pres)
> end
>
> _______________________________________________
> ncl-talk mailing list
> 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/20140806/86771abb/attachment.html 


More information about the ncl-talk mailing list