“IDL8”的版本间差异
跳到导航
跳到搜索
(→画图) |
(→画图) |
||
第17行: | 第17行: | ||
*symbol |
*symbol |
||
:画符号,支持latex |
:画符号,支持latex |
||
*save |
|||
:可以直接把图保存成文件 |
|||
p = OBJARR(3) |
|||
; Create three plots with random data |
|||
FOR i = 0, 2 DO BEGIN |
|||
t = 0.1*FINDGEN(50) |
|||
y = SMOOTH(RANDOMU(seed,50), 5) |
|||
p[i] = PLOT(t,y,'b', SYMBOL='D', TITLE='Observation'+STRING(i+1)) |
|||
ENDFOR |
|||
; Build the multi-page PDF file, one page at a time |
|||
p[0].Save, 'data1.pdf', /APPEND |
|||
p[1].Save, 'data1.pdf', /APPEND |
|||
p[2].Save, 'data1.pdf', /APPEND, /CLOSE |
|||
*legend |
*legend |
2016年12月10日 (六) 14:59的版本
系统变量
- !const
常用物理常数
画图
- errorplot
- 完整的误差棒程序
- barplot
- 棒状图
- boxplot
- polarplot
- 极坐标
- vector
- 画矢量图(箭头)
- streamline
- symbol
- 画符号,支持latex
- save
- 可以直接把图保存成文件
p = OBJARR(3) ; Create three plots with random data FOR i = 0, 2 DO BEGIN t = 0.1*FINDGEN(50) y = SMOOTH(RANDOMU(seed,50), 5) p[i] = PLOT(t,y,'b', SYMBOL='D', TITLE='Observation'+STRING(i+1)) ENDFOR ; Build the multi-page PDF file, one page at a time p[0].Save, 'data1.pdf', /APPEND p[1].Save, 'data1.pdf', /APPEND p[2].Save, 'data1.pdf', /APPEND, /CLOSE
- legend
a = findgen(11) b = 20./(a+1)^2 p1 = PLOT(a, b, '4', /HISTOGRAM, NAME='Theoretical', /YLOG, YRANGE=[0.01,100]) p2 = PLOT(RANDOMU(-1, 11), '4r', NAME='Experimental', TRANSPARENCY=50, /HISTOGRAM, /OVERPLOT) h = LEGEND(POSITION=[9,50], /DATA)
- 画多个panel的时候可以用layout关键词,而且可以动态调整
fn = exp(SIN(FINDGEN(100))^FINDGEN(100)) w1 = WINDOW() p1 = PLOT(fn, LAYOUT = [1, 2, 1], /CURRENT, TITLE = '1') p2 = PLOT(fn, LAYOUT = [2, 2, 3], xrange=[25, 42], /CURRENT, TITLE = '2') p3 = PLOT(fn, LAYOUT = [2, 2, 4], xrange=[50, 60], /CURRENT, TITLE = '3')
- colorbar 用法更自由,target关键词,不需要自己设计
- 直接支持latex符号,text函数
- AXES可以直接在image上画坐标轴
地图相关
- map (可以投影天球)
mymap = MAP('hammer', FILL_COLOR="light_blue") ; Convert from longitude/latitude to meters longitudes = [-83.02, 88.50] latitudes = [42.42, 47.17] xy = mymap.MapForward(longitudes, latitudes) ; Convert back to longitude/latitude and plot EXPAND, xy, 2, 20, xycoordinates lonlat = mymap.MapInverse(xycoordinates) p = PLOT(lonlat[0,*], lonlat[1,*], 'rS', /OVERPLOT, /SYM_FILLED)
数组运算
- array_equal