本文整理汇总了Golang中github.com/cpmech/gosl/io.Ff函数的典型用法代码示例。如果您正苦于以下问题:Golang Ff函数的具体用法?Golang Ff怎么用?Golang Ff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Ff函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Title
func Title(txt, args string) {
if len(args) > 0 {
io.Ff(&bb, "title('%s',%s)\n", txt, args)
} else {
io.Ff(&bb, "title('%s')\n", txt)
}
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例2: PlotOne
func PlotOne(x, y float64, args string) {
if len(args) > 0 {
io.Ff(&bb, "plot(%23.15e,%23.15e,%s)\n", x, y, args)
} else {
io.Ff(&bb, "plot(%23.15e,%23.15e)\n", x, y)
}
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例3: Text
func Text(x, y float64, txt, args string) {
if len(args) > 0 {
io.Ff(&bb, "text(%g,%g,'%s',%s)\n", x, y, txt, args)
} else {
io.Ff(&bb, "text(%g,%g,'%s')\n", x, y, txt)
}
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例4: Cross
func Cross(args string) {
if len(args) > 0 {
io.Ff(&bb, "Cross(%s)\n", args)
} else {
io.Ff(&bb, "Cross()\n")
}
}
开发者ID:PaddySchmidt,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例5: GenArray
// GenArray generates the NumPy text in 'b' corresponding to an array of float point numbers
func GenArray(b *bytes.Buffer, name string, u []float64) {
io.Ff(b, "%s=array([", name)
for i, _ := range u {
io.Ff(b, "%g,", u[i])
}
io.Ff(b, "],dtype=float)\n")
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:8,代码来源:mplotlib.go
示例6: GenStrArray
// GenStrArray generates the NumPy text in 'b' corresponding to an array of strings
func GenStrArray(b *bytes.Buffer, name string, u []string) {
io.Ff(b, "%s=[", name)
for i, _ := range u {
io.Ff(b, "%q,", u[i])
}
io.Ff(b, "]\n")
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:8,代码来源:mplotlib.go
示例7: write_python_array
func write_python_array(buf *bytes.Buffer, name string, x []float64) {
io.Ff(buf, "%s=np.array([", name)
for i := 0; i < len(x); i++ {
io.Ff(buf, "%g,", x[i])
}
io.Ff(buf, "])\n")
}
开发者ID:yunpeng1,项目名称:gosl,代码行数:7,代码来源:t_pareto_test.go
示例8: SupTitle
func SupTitle(txt, args string) {
n := bb.Len()
if len(args) > 0 {
io.Ff(&bb, "st%d = suptitle('%s',%s)\n", n, txt, args)
} else {
io.Ff(&bb, "st%d = suptitle('%s')\n", n, txt)
}
io.Ff(&bb, "ea.append(st%d)\n", n)
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:9,代码来源:mplotlib.go
示例9: xResRow
// xResRow adds row to table with X results
func (o *TexReport) xResRow(opt *Optimiser) {
if !o.singleObj {
return
}
io.Ff(o.bxres, "%s &\n", opt.RptName)
io.Ff(o.bxres, " $x_{best} = $"+opt.RptFmtX+" \\\\ \n", opt.BestOfBestFlt)
if len(opt.RptXref) == opt.Nflt {
io.Ff(o.bxres, "& $x_{ref.} = $"+opt.RptFmtX+" \\\\ \n", opt.RptXref)
}
}
开发者ID:cpmech,项目名称:goga,代码行数:11,代码来源:report.go
示例10: GenList
// GenList generates list
func GenList(buf *bytes.Buffer, name string, a [][]float64) {
io.Ff(buf, "%s=[", name)
for i, _ := range a {
io.Ff(buf, "[")
for j, _ := range a[i] {
io.Ff(buf, "%g,", a[i][j])
}
io.Ff(buf, "],")
}
io.Ff(buf, "]\n")
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:12,代码来源:mplotlib.go
示例11: Plot
func Plot(x, y []float64, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
Gen2Arrays(&bb, sx, sy, x, y)
if len(args) > 0 {
io.Ff(&bb, "plot(%s,%s,%s)\n", sx, sy, args)
} else {
io.Ff(&bb, "plot(%s,%s)\n", sx, sy)
}
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:11,代码来源:mplotlib.go
示例12: GenMat
// GenMat generates matrix
func GenMat(buf *bytes.Buffer, name string, a [][]float64) {
io.Ff(buf, "%s=array([", name)
for i, _ := range a {
io.Ff(buf, "[")
for j, _ := range a[i] {
io.Ff(buf, "%g,", a[i][j])
}
io.Ff(buf, "],")
}
io.Ff(buf, "],dtype=float)\n")
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:12,代码来源:mplotlib.go
示例13: write_python_matrix
func write_python_matrix(buf *bytes.Buffer, name string, xy [][]float64) {
io.Ff(buf, "%s=np.array([", name)
for i := 0; i < len(xy); i++ {
io.Ff(buf, "[")
for j := 0; j < len(xy[i]); j++ {
io.Ff(buf, "%g,", xy[i][j])
}
io.Ff(buf, "],\n")
}
io.Ff(buf, "])\n")
}
开发者ID:yunpeng1,项目名称:gosl,代码行数:11,代码来源:t_pareto_test.go
示例14: Hist
func Hist(x [][]float64, labels []string, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
GenList(&bb, sx, x)
GenStrArray(&bb, sy, labels)
if len(args) > 0 {
io.Ff(&bb, "hist(%s,label=%s,%s)\n", sx, sy, args)
} else {
io.Ff(&bb, "hist(%s,label=%s)\n", sx, sy)
}
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:12,代码来源:mplotlib.go
示例15: vtu_write
func vtu_write(geo, dat *bytes.Buffer) {
if geo == nil || dat == nil {
return
}
nv := len(verts)
nc := len(cells)
var hdr, foo bytes.Buffer
io.Ff(&hdr, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n<UnstructuredGrid>\n")
io.Ff(&hdr, "<Piece NumberOfPoints=\"%d\" NumberOfCells=\"%d\">\n", nv, nc)
io.Ff(&foo, "</Piece>\n</UnstructuredGrid>\n</VTKFile>\n")
io.WriteFileVD(dirout, fnkey+".vtu", &hdr, geo, dat, &foo)
}
开发者ID:PaddySchmidt,项目名称:gofem,代码行数:12,代码来源:Msh2vtu.go
示例16: Wireframe
func Wireframe(x, y, z [][]float64, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
sz := io.Sf("z%d", n)
GenMat(&bb, sx, x)
GenMat(&bb, sy, y)
GenMat(&bb, sz, z)
cmd := io.Sf("ax%d = Wireframe(%s,%s,%s", n, sx, sy, sz)
if len(args) > 0 {
cmd += io.Sf(",%s", args)
}
io.Ff(&bb, "%s)\n", cmd)
io.Ff(&bb, "ea.append(ax%d)\n", n)
}
开发者ID:yunpeng1,项目名称:gosl,代码行数:15,代码来源:mplotlib.go
示例17: Plot3dPoints
func Plot3dPoints(x, y, z []float64, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
sz := io.Sf("z%d", n)
GenArray(&bb, sx, x)
GenArray(&bb, sy, y)
GenArray(&bb, sz, z)
cmd := io.Sf("ax%d = Plot3dPoints(%s,%s,%s", n, sx, sy, sz)
if len(args) > 0 {
cmd += io.Sf(",%s", args)
}
io.Ff(&bb, "%s)\n", cmd)
io.Ff(&bb, "ea.append(ax%d)\n", n)
}
开发者ID:yunpeng1,项目名称:gosl,代码行数:15,代码来源:mplotlib.go
示例18: Camera
func Camera(elev, azim float64, args string) {
cmd := io.Sf("gca().view_init(elev=%g, azim=%g", elev, azim)
if len(args) > 0 {
cmd += io.Sf(",%s", args)
}
io.Ff(&bb, "%s)\n", cmd)
}
开发者ID:yunpeng1,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例19: Circle
func Circle(xc, yc, r float64, args string) {
cmd := io.Sf("Circle(%g,%g,%g", xc, yc, r)
if len(args) > 0 {
cmd += io.Sf(",%s", args)
}
io.Ff(&bb, "%s)\n", cmd)
}
开发者ID:PatrickSchm,项目名称:gosl,代码行数:7,代码来源:mplotlib.go
示例20: pvd_write
func pvd_write(buf *bytes.Buffer, label string) {
if buf == nil {
return
}
io.Ff(buf, "</Collection>\n</VTKFile>")
io.WriteFileV(io.Sf("%s/%s_%s.pvd", dirout, fnkey, label), buf)
}
开发者ID:PaddySchmidt,项目名称:gofem,代码行数:7,代码来源:GenVtu.go
注:本文中的github.com/cpmech/gosl/io.Ff函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论