Skip to content

Commit

Permalink
plotter: fix documentation typo and clarify example
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Apr 6, 2019
1 parent f2023ba commit 99b5ceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plotter/heat.go
Expand Up @@ -24,7 +24,7 @@ type GridXYZ interface {
// It will panic if c or r are out of bounds for the grid.
Z(c, r int) float64

// X returns the coordinate for the column at the index x.
// X returns the coordinate for the column at the index c.
// It will panic if c is out of bounds for the grid.
X(c int) float64

Expand Down
4 changes: 2 additions & 2 deletions plotter/heat_test.go
Expand Up @@ -32,14 +32,14 @@ func (g offsetUnitGrid) Z(c, r int) float64 { return g.Data.At(r, c) }
func (g offsetUnitGrid) X(c int) float64 {
_, n := g.Data.Dims()
if c < 0 || c >= n {
panic("index out of range")
panic("column index out of range")
}
return float64(c) + g.XOffset
}
func (g offsetUnitGrid) Y(r int) float64 {
m, _ := g.Data.Dims()
if r < 0 || r >= m {
panic("index out of range")
panic("row index out of range")
}
return float64(r) + g.YOffset
}
Expand Down

0 comments on commit 99b5ceb

Please sign in to comment.