本文整理汇总了Golang中code/google/com/p/plotinum/plot.DrawArea.StrokeLine2方法的典型用法代码示例。如果您正苦于以下问题:Golang DrawArea.StrokeLine2方法的具体用法?Golang DrawArea.StrokeLine2怎么用?Golang DrawArea.StrokeLine2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类code/google/com/p/plotinum/plot.DrawArea
的用法示例。
在下文中一共展示了DrawArea.StrokeLine2方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Plot
func (b *QuartPlot) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
x := trX(b.Location)
if !da.ContainsX(x) {
return
}
x += b.Offset
med := plot.Pt(x, trY(b.Median))
q1 := trY(b.Quartile1)
q3 := trY(b.Quartile3)
aLow := trY(b.AdjLow)
aHigh := trY(b.AdjHigh)
da.StrokeLine2(b.WhiskerStyle, x, aHigh, x, q3)
if da.ContainsY(med.Y) {
da.DrawGlyphNoClip(b.MedianStyle, med)
}
da.StrokeLine2(b.WhiskerStyle, x, aLow, x, q1)
ostyle := b.MedianStyle
ostyle.Radius = b.MedianStyle.Radius / 2
for _, out := range b.Outside {
y := trY(b.Value(out))
if da.ContainsY(y) {
da.DrawGlyphNoClip(ostyle, plot.Pt(x, y))
}
}
}
示例2: Plot
// Plot implements the plot.Plotter interface.
func (g *Grid) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
if g.Vertical.Color == nil {
goto horiz
}
for _, tk := range plt.X.Tick.Marker(plt.X.Min, plt.X.Max) {
if tk.IsMinor() {
continue
}
x := trX(tk.Value)
da.StrokeLine2(g.Vertical, x, da.Min.Y, x, da.Min.Y+da.Size.Y)
}
horiz:
if g.Horizontal.Color == nil {
return
}
for _, tk := range plt.Y.Tick.Marker(plt.Y.Min, plt.Y.Max) {
if tk.IsMinor() {
continue
}
y := trY(tk.Value)
da.StrokeLine2(g.Horizontal, da.Min.X, y, da.Min.X+da.Size.X, y)
}
}
示例3: Thumbnail
// Thumbnail the thumbnail for the Line,
// implementing the plot.Thumbnailer interface.
func (pts *Line) Thumbnail(da *plot.DrawArea) {
if pts.ShadeColor != nil {
points := []plot.Point{
{da.Min.X, da.Min.Y},
{da.Min.X, da.Max().Y},
{da.Max().X, da.Max().Y},
{da.Max().X, da.Min.Y},
}
poly := da.ClipPolygonY(points)
da.FillPolygon(*pts.ShadeColor, poly)
points = append(points, plot.Pt(da.Min.X, da.Min.Y))
} else {
y := da.Center().Y
da.StrokeLine2(pts.LineStyle, da.Min.X, y, da.Max().X, y)
}
}
示例4: Plot
func (b HorizQuartPlot) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
y := trY(b.Location)
if !da.ContainsY(y) {
return
}
med := plot.Pt(trX(b.Median), y)
q1 := trX(b.Quartile1)
q3 := trX(b.Quartile3)
aLow := trX(b.AdjLow)
aHigh := trX(b.AdjHigh)
da.StrokeLine2(b.WhiskerStyle, aHigh, y, q3, y)
da.DrawGlyph(b.MedianStyle, med)
da.StrokeLine2(b.WhiskerStyle, aLow, y, q1, y)
ostyle := b.MedianStyle
ostyle.Radius = b.MedianStyle.Radius / 2
for _, out := range b.Outside {
x := trX(b.Value(out))
da.DrawGlyph(ostyle, plot.Pt(x, y))
}
}
示例5: Thumbnail
// Thumbnail draws a line in the given style down the
// center of a DrawArea as a thumbnail representation
// of the LineStyle of the function.
func (f Function) Thumbnail(da *plot.DrawArea) {
y := da.Center().Y
da.StrokeLine2(f.LineStyle, da.Min.X, y, da.Max().X, y)
}
示例6: Thumbnail
func (l *LineThumbnailer) Thumbnail(da *plot.DrawArea) {
y := da.Center().Y
da.StrokeLine2(l.LineStyle, da.Min.X, y, da.Max().X, y)
}
示例7: Thumbnail
// Thumbnail the thumbnail for the Line,
// implementing the plot.Thumbnailer interface.
func (pts *Line) Thumbnail(da *plot.DrawArea) {
y := da.Center().Y
da.StrokeLine2(pts.LineStyle, da.Min.X, y, da.Max().X, y)
}
示例8: 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)
}
示例9: 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)
}