Original issue 141 created by eaburns on 2014-05-07T23:29:40.000Z:
You shouldn't have to look at how the error bar plotter draws its lines to figure out how to pass data into the plotter.
BTW, the error values returned by the error interfaces is two positive numbers that the plotter automatically subtracts and adds to the middle value for you:
Original issue 141 created by eaburns on 2014-05-07T23:29:40.000Z:
You shouldn't have to look at how the error bar plotter draws its lines to figure out how to pass data into the plotter.
BTW, the error values returned by the error interfaces is two positive numbers that the plotter automatically subtracts and adds to the middle value for you:
package main
import ( "code.google.com/p/plotinum/plot" "code.google.com/p/plotinum/plotter" )
type XYMeanErr []struct { X float64 YMean, YError float64 }
func (e XYMeanErr) Len() int { return len(e) }
func (e XYMeanErr) XY(i int) (x, y float64) { return e[i].X, e[i].YMean }
func (e XYMeanErr) YError(i int) (float64, float64) { yerr := e[i].YError return yerr, yerr }
func main() { data := XYMeanErr{ {0, 10, 5}, {1, 10, 5}, {2, 20, 10}, }
}