diff --git a/asciigraph.go b/asciigraph.go index 608eb6a..08ddd8b 100644 --- a/asciigraph.go +++ b/asciigraph.go @@ -128,8 +128,10 @@ func PlotMany(data [][]float64, options ...Option) string { // axis and labels for y := intmin2; y < intmax2+1; y++ { var magnitude float64 - if rows > 0 { + if rows > 0 && interval > 0 { magnitude = maximum - (float64(y-intmin2) * interval / float64(rows)) + } else if interval == 0 { + magnitude = minimum } else { magnitude = float64(y) }