本文整理汇总了Golang中code/google/com/p/plotinum/plot.DrawArea.Contains方法的典型用法代码示例。如果您正苦于以下问题:Golang DrawArea.Contains方法的具体用法?Golang DrawArea.Contains怎么用?Golang DrawArea.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类code/google/com/p/plotinum/plot.DrawArea
的用法示例。
在下文中一共展示了DrawArea.Contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Plot
// Plot implements the Plotter interface, drawing labels.
func (l *Labels) Plot(da plot.DrawArea, p *plot.Plot) {
trX, trY := p.Transforms(&da)
for i, label := range l.Labels {
x := trX(l.XYs[i].X)
y := trY(l.XYs[i].Y)
if !da.Contains(plot.Pt(x, y)) {
continue
}
x += l.XOffset
y += l.YOffset
da.FillText(l.TextStyle, x, y, l.XAlign, l.YAlign, label)
}
}
示例2: Plot
// Plot implements the Plot method of the plot.Plotter interface.
func (bs *Bubbles) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
da.SetColor(bs.Color)
for _, d := range bs.XYZs {
x := trX(d.X)
y := trY(d.Y)
if !da.Contains(plot.Point{x, y}) {
continue
}
rad := bs.radius(d.Z)
// draw a circle centered at x, y
var p vg.Path
p.Move(x+rad, y)
p.Arc(x, y, rad, 0, 2*math.Pi)
p.Close()
da.Fill(p)
}
}
示例3: drawCap
// drawCap draws the cap if it is not clipped.
func (e *YErrorBars) drawCap(da *plot.DrawArea, x, y vg.Length) {
if !da.Contains(plot.Pt(x, y)) {
return
}
da.StrokeLine2(e.LineStyle, x-e.CapWidth/2, y, x+e.CapWidth/2, y)
}
示例4: drawCap
// drawCap draws the cap if it is not clipped.
func (e *XErrorBars) drawCap(da *plot.DrawArea, x, y vg.Length) {
if !da.Contains(plot.Point{x, y}) {
return
}
da.StrokeLine2(e.LineStyle, x, y-e.CapWidth/2, x, y+e.CapWidth/2)
}