summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Grebenshchikov <sgreben@gmail.com>2018-03-30 22:50:08 +0200
committerSergey Grebenshchikov <sgreben@gmail.com>2018-03-30 22:50:08 +0200
commit152033fc63285a05e9c7a407718d6ebc1896fe64 (patch)
treee1e0861bc09edf0ce9a897cc518fe77fe5f451bc
parent4a608105bcab96ca98eb405159faa626b7d8193e (diff)
Fix flipped heatmap coordinates
-rw-r--r--pkg/plot/heatmap.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/plot/heatmap.go b/pkg/plot/heatmap.go
index 2667b40..f02a461 100644
--- a/pkg/plot/heatmap.go
+++ b/pkg/plot/heatmap.go
@@ -51,10 +51,10 @@ func (c *HeatMap) Draw(heatmap *data.Heatmap) string {
for i := range heatmap.Z {
for j := range heatmap.Z[i] {
- x0 := int((heatmap.X[j].LeftInclusive-minX)*scaleX + float64(paddingX+1))
- y0 := int((heatmap.Y[i].LeftInclusive-minY)*scaleY + float64(paddingY))
- x1 := int((heatmap.X[j].Right-minX)*scaleX + float64(paddingX+1))
- y1 := int((heatmap.Y[i].Right-minY)*scaleY + float64(paddingY))
+ x0 := int((heatmap.X[i].LeftInclusive-minX)*scaleX + float64(paddingX+1))
+ y0 := int((heatmap.Y[j].LeftInclusive-minY)*scaleY + float64(paddingY))
+ x1 := int((heatmap.X[i].Right-minX)*scaleX + float64(paddingX+1))
+ y1 := int((heatmap.Y[j].Right-minY)*scaleY + float64(paddingY))
z := heatmap.Z[i][j]
for x := x0; x < x1; x++ {
for y := y0; y < y1; y++ {