爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
12
返回列表 发新帖
楼主: XiaoDeeOfShaG

[MeteoExplorer主题] IDL 气象常用 雷达、卫星、格点数据、统计图(箱型图、柱形图。。)Coyote 懒人程...

[复制链接]

新浪微博达人勋

 楼主| 发表于 2023-11-3 15:49:50 | 显示全部楼层
赵家清欢 发表于 2023-7-31 08:48
想问一下,您知道坐标轴想用英文表示怎么做呢?我试了一下,这个坐标轴只会用数字表示?

; docformat = 'rst'
;+
; This is an example program to demonstrate how to create a zonal wind plot
; with Coyote Graphics routines.
;
; :Categories:
;    Graphics
;   
; :Examples:
;    Save the program as "zonal_wind_plot.pro" and run it like this::
;       IDL> .RUN zonal_wind_plot
;      
; :Author:
;    FANNING SOFTWARE CONSULTING::
;       David W. Fanning
;       1645 Sheely Drive
;       Fort Collins, CO 80526 USA
;       Phone: 970-221-0438
;       E-mail: david@idlcoyote.com
;       Coyote's Guide to IDL Programming: http://www.idlcoyote.com
;
; :History:
;     Change History::
;        Written, 10 February 2013 by David W. Fanning.
;
; :Copyright:
;     Copyright (c) 2013, Fanning Software Consulting, Inc.
;-
PRO Zonal_Wind_Plot

   ; Set up variables for the plot. Normally, these values would be
   ; passed into the program as positional and keyword parameters.
   ; Data file obtained here: http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun11n.shtml.
   file = 'cocos_island.dat'
   
   ; Read the ASCII data file. First column is pressure. Second column is height.
   ; Next 12 columns are zonal winds for each month.
   OpenR, lun, file, /Get_Lun
   lines = File_Lines(file)
   data = Fltarr(14, lines)
   ReadF, lun, data
   Free_Lun, lun
   
   ; Reformat pressure and height as row vectors.
   pressure = Reform(data[0,*])
   height = Reform(data[1,*])
   
   ; Get dimension of wind data set.
   monthlyWinds = data[2:*,*]
   dims = Size(monthlyWinds, /Dimensions)
   
   ; Create a month vector for plotting purposes
   time = Indgen(12)
   tick_names = cgMonths(time+1, /FirstLetter, /Abbreviation)

   ; Scale the height for drawing zonal winds and load program colors.
   heightColors = BytScl(height, Min=0, Max=23, Top=23)
   cgLoadCT, 33, NColors=24

   ; Open a display window.
   cgDisplay

   ; Set up plotting parameters.
   thick = (!D.Name EQ 'PS') ? 6 : 2
   plotPosition = [0.125, 0.125, 0.9, 0.75]
   
   ; Draw a gray background so colors stand out more.
   cgColorFill, Position=plotPosition, Color='gray'
   
   ; Draw the initial plot, no data.
   cgPlot, time, monthlyWinds[*, 0], YRange=[-20,10], YStyle=1, $
       YTitle='Amplitude (m/s)', XTitle='Month', XStyle=1, $
       XTicks=11, XTickName=tick_names, /NoData, /NoErase, $
       Position=plotPosition, Label='Zonal Winds Cocos Island'
      
   ; Overplot the zonal winds in colors scaled by height.
   FOR j=0,dims[1]-1 DO cgPlotS, time, monthlyWinds[*,j], time, $
       Color=heightColors[j], Thick=thick
      
   ; Add a color bar.
   cgColorbar, Divisions=24, NColors=24, Range=[0,24], Title='Height (km)', $
       TLocation='top', /Discrete, Format='(i0)', Position=[0.125, 0.86, 0.9, 0.90]
      
END ;*****************************************************************
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表