(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestScatter(t *testing.T) { |
| 84 | pt := plot.New() |
| 85 | pt.Title.Text = "Test Scatter" |
| 86 | pt.X.Min = 0 |
| 87 | pt.X.Max = 100 |
| 88 | pt.X.Label.Text = "X Axis" |
| 89 | pt.Y.Min = 0 |
| 90 | pt.Y.Max = 100 |
| 91 | pt.Y.Label.Text = "Y Axis" |
| 92 | |
| 93 | data := make(plot.XYs, 21) |
| 94 | for i := range data { |
| 95 | data[i].X = float32(i * 5) |
| 96 | data[i].Y = float32(50) + 40*math32.Sin((float32(i)/8)*math32.Pi) |
| 97 | } |
| 98 | |
| 99 | l1, err := NewScatter(data) |
| 100 | if err != nil { |
| 101 | t.Error(err.Error()) |
| 102 | } |
| 103 | pt.Add(l1) |
| 104 | |
| 105 | pt.Resize(image.Point{640, 480}) |
| 106 | |
| 107 | shs := ShapesValues() |
| 108 | for _, sh := range shs { |
| 109 | l1.PointShape = sh |
| 110 | pt.Draw() |
| 111 | imagex.Assert(t, pt.Pixels, "scatter-"+sh.String()+".png") |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | func TestLabels(t *testing.T) { |
| 116 | pt := plot.New() |
nothing calls this directly
no test coverage detected