Sie sind hier: Startseite / Services / Data Analysis and Visualization / Visualization / Software / NCL / examples / source_code / DKRZ NCL xy-plot example
Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

DKRZ NCL xy-plot example

The script creates a simple xy-plot from 1D data and write the plot to a PNG file.

Example script:

;-----------------------------------------------------------------
;  DKRZ - NCL Example:   NCL_xy_plot.ncl
;
; - 1D data
; - change line color
; - make line thicker
; - double-spaced title
; ; 30.10.14 kmf ;----------------------------------------------------------------- begin x = (/1,2,3,4,5,6,7,8,9,10/) ;-- define data y = (/3,7,4,9,2,1,8,8,4,2/) ;-- define data wks_type = "png" ;-- graphics output type wks_type@wkWidth = 1024 ;-- graphics output width in pixel wks_type@wkHeight = 1024 ;-- graphics output height in pixel wks = gsn_open_wks(wks_type,"plot_xy_plot") ;-- open the workstation res = True ;-- resource object res@tiMainString = "DKRZ - NCL Example:~C~ xy-plot resources" ;-- title string res@xyLineColor = "blue" ;-- define line color res@xyLineThicknessF = 5 ;-- define line thickness plot = gsn_csm_xy(wks, x, y, res) ;-- create xy-plot end

Artikelaktionen