;************************************************* ; histo_1.ncl ; ; Concepts illustrated: ; - Drawing a default histogram ; - Generating dummy data using "rand" ; ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ;************************************************ begin ;************************************************ ; Generate some random data. ;************************************************ x = new(1000,integer) do i=0,dimsizes(x)-1 x(i) = rand() end do x = x/320 ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("ps","histo") ; open workstation gsn_define_colormap(wks,"temp1") ; choose colormap ; with the default behavior, NCL choose your bins based on a range ; of "nice" integer values. Therefore you may not get exactly 10 ; bins plot=gsn_histogram(wks,x,False) ; create histogram with 10 bins end