爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3993|回复: 2

我参考做的一个surfer画图的程序,但是画出来不显示等值线,求解答

[复制链接]

新浪微博达人勋

发表于 2013-8-21 11:41:52 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
2.jpg 1.jpg 如图所示,我想让等值线像黄色那幅图一样显示出来,该如何做,附上代码

With dlgCommon1
    .DialogTitle = "打开数据文件"
    .Flags = 0
    .CancelError = True
    .FileName = ""
    .Filter = "数据文件 (*.dat)|*.dat"
    .ShowOpen
    If Len(.FileName) = 0 Then
        Exit Sub
    End If
    strinfile = .FileName
  End With
strGridFile = Left(strinfile, Val(InStrRev(strinfile, ".")) - 1) + ".grd"
Set SurferApp = CreateObject("Surfer.Application")
SurferApp.Visible = False
SurferApp.GridData DataFile:=App.Path & "\雨量.dat", xCol:=1, yCol:=2, zCol:=3, Algorithm:=2, DupMethod:=2, ShowReport:=False, OutGrid:=App.Path & "\差值后.grd", xMin:=105.589, xMax:=106.125, yMin:=28.95, yMax:=29.56
SurferApp.GridBlank InGrid:=App.Path & "\差值后.grd", BlankFile:=App.Path & "\永川边界.bln", OutGrid:=App.Path & "\差值后.grd"
Set Plot = SurferApp.Documents.Add(1)
Set ContourMapFrame = Plot.Shapes.AddContourMap(App.Path & "\差值后.grd ")
       Set ContourMap = ContourMapFrame.Overlays(1)
ContourMap.Levels.LoadFile (App.Path & "\降水")
ContourMap.SmoothContours = 4
ContourMap.ShowColorScale = True
  ContourMap.FillContours = True
Set baseMap = Plot.Shapes.AddBaseMap(ImportFileName:=App.Path & "\永川边界.bln")
Set postmapframe = Plot.Shapes.AddPostMap(dataFileName:=App.Path & "\站点信息.txt", xCol:=1, yCol:=2, LabCol:=3)
Set postmap1 = postmapframe.Overlays(1)
Set MkFormat = postmap1.Symbol
With MkFormat
.Size = 0.05
.Index = 12
End With
Set lbFont = postmap1.LabelFont
With lbFont
.Face = "宋体"
.Size = 8
End With
Set baseMap = Plot.Shapes.AddBaseMap(ImportFileName:=App.Path & "\永川边界.bln")
Set postmapframe = Plot.Shapes.AddPostMap(dataFileName:=App.Path & "\雨量.dat", xCol:=1, yCol:=2, LabCol:=3)
Set postmap1 = postmapframe.Overlays(1)
Set MkFormat = postmap1.Symbol
With MkFormat
.Size = 0.000000001
.Index = 0
End With
Set lbFont = postmap1.LabelFont
With lbFont
.Face = "黑体"
.Size = 7
End With
Set adtext = Plot.Shapes.AddText(X:=7.2, Y:=3.4, Text:="单位:毫米")
With adtext.Font
.Face = "黑体"
Size = 14
End With
Plot.Shapes.SelectAll
Plot.Selection.OverlayMaps
Plot.Export FileName:=App.Path & "\雨量图.gif", Options:="Width=700,Height=700"
Plot.Close
SurferApp.Quit
Picture1.Picture = LoadPicture(App.Path & "\雨量图.gif")
End Sub

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-8-22 07:11:46 | 显示全部楼层
应该在你的色标文件里进行设置
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-2-13 22:31:46 | 显示全部楼层
新年好!!!!!!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

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

本版积分规则

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

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

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