Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Plot 如何在NCAR命令语言(NCL)中使打印边缘平滑?_Plot_Data Visualization_Contour_Ncl - Fatal编程技术网

Plot 如何在NCAR命令语言(NCL)中使打印边缘平滑?

Plot 如何在NCAR命令语言(NCL)中使打印边缘平滑?,plot,data-visualization,contour,ncl,Plot,Data Visualization,Contour,Ncl,如何使由gsn_csm_contour_map创建的绘图边缘平滑,而不是使用这些蓝色正方形 我尝试过不同的填充模式,但没有一种有效。 ncl中是否有活动轮廓功能?是否可以在空值和非空值之间创建轮廓 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts

如何使由gsn_csm_contour_map创建的绘图边缘平滑,而不是使用这些蓝色正方形

我尝试过不同的填充模式,但没有一种有效。 ncl中是否有活动轮廓功能?是否可以在空值和非空值之间创建轮廓

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

;======================================================================
; The main code
;======================================================================

begin
;---Read desired data
    sfile = addfile(f,"r")
    var = sfile->var1

;---For zooming in on map
    minlat =  foo
    maxlat =  bar
    minlon = foo1
    maxlon = bar1

;---Get dimentions
    dims = dimsizes(var)
    nlev = dims(0)
    time = var&time
    date_str_i = getDate(time)

;---Set some resources
    res                   = True

    res@cnFillOn          = True
    ;res@cnFillMode        = "RasterFill"
    ;res@cnRasterSmoothingOn =True
    res@cnLinesOn         = False
    res@cnLineLabelsOn    = True

    res@cnLevelSelectionMode = "ManualLevels"
    res@cnMinLevelValF       = -100
    res@cnMaxLevelValF       = 3000
    res@cnLevelSpacingF      = 200 ; 300 ; 50 ; 150

    res@mpMinLatF         = minlat 
    res@mpMaxLatF         = maxlat 
    res@mpMinLonF         = minlon 
    res@mpMaxLonF         = maxlon
    res@mpDataBaseVersion = "HighRes" 

    res@cnSmoothingOn     = True
    res@cnSmoothingDistanceF = 0.005
    res@cnSmoothingTensionF = 0.001
    res@mpCenterLonF      = (minlon+maxlon)*0.5
    res@mpCenterLatF      = (minlat+maxlat)*0.5

    res@pmTickMarkDisplayMode = "Always"

    res@lbLabelFontHeightF    = 0.01

    res@gsnAddCyclic      = False       ; this is regional data

;---Loop across each level and plot to a different PNG file every time
    do n=4,nlev-1
    wks_type = "png"
    wks_type@wkWidth = 2000
    wks_type@wkHeight = 2000
        wks = gsn_open_wks(wks_type,fname(0)+sprinti("%03i",n))    ;
        res@gsnRightString = "Time:" + date_str_i(n)
        res@gsnStringFontHeightF = 0.010
        plot = gsn_csm_contour_map_ce(wks,var(n,:,:),res)
        delete(wks)  

    end do
end
但我有点怀疑它是否与代码相关。

您必须使用:

res@cnFillMode        = "AreaFill"
res@cnFillOn          = True

您应该将用于获得此结果的代码添加到问题中。谢谢,我将添加它。