本文整理匯總了Golang中code/google/com/p/plotinum/plot.DrawArea.DrawGlyph方法的典型用法代碼示例。如果您正苦於以下問題:Golang DrawArea.DrawGlyph方法的具體用法?Golang DrawArea.DrawGlyph怎麽用?Golang DrawArea.DrawGlyph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code/google/com/p/plotinum/plot.DrawArea
的用法示例。
在下文中一共展示了DrawArea.DrawGlyph方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Plot
func (b *BoxPlot) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
x := trX(b.Location)
if !da.ContainsX(x) {
return
}
med := trY(b.Median)
q1 := trY(b.Quartile1)
q3 := trY(b.Quartile3)
aLow := trY(b.AdjLow)
aHigh := trY(b.AdjHigh)
box := da.ClipLinesY([]plot.Point{
{x - b.Width/2, q1},
{x - b.Width/2, q3},
{x + b.Width/2, q3},
{x + b.Width/2, q1},
{x - b.Width/2 - b.BoxStyle.Width/2, q1},
})
da.StrokeLines(b.BoxStyle, box...)
medLine := da.ClipLinesY([]plot.Point{
{x - b.Width/2, med},
{x + b.Width/2, med},
})
da.StrokeLines(b.MedianStyle, medLine...)
cap := b.CapWidth / 2
whisks := da.ClipLinesY([]plot.Point{{x, q3}, {x, aHigh}},
[]plot.Point{{x - cap, aHigh}, {x + cap, aHigh}},
[]plot.Point{{x, q1}, {x, aLow}},
[]plot.Point{{x - cap, aLow}, {x + cap, aLow}})
da.StrokeLines(b.WhiskerStyle, whisks...)
for _, out := range b.Outside {
y := trY(b.Value(out))
da.DrawGlyph(b.GlyphStyle, plot.Point{x, y})
}
}
示例2: 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
}
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)
da.DrawGlyph(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))
da.DrawGlyph(ostyle, plot.Pt(x, y))
}
}
示例3: Thumbnail
// Thumbnail the thumbnail for the Scatter,
// implementing the plot.Thumbnailer interface.
func (pts *Scatter) Thumbnail(da *plot.DrawArea) {
da.DrawGlyph(pts.GlyphStyle, da.Center())
}
示例4: Plot
// Plot draws the Scatter, implementing the plot.Plotter
// interface.
func (pts *Scatter) Plot(da plot.DrawArea, plt *plot.Plot) {
trX, trY := plt.Transforms(&da)
for _, p := range pts.XYs {
da.DrawGlyph(pts.GlyphStyle, plot.Pt(trX(p.X), trY(p.Y)))
}
}