diff options
author | Sergey Grebenshchikov <sgreben@gmail.com> | 2018-03-28 22:14:34 +0200 |
---|---|---|
committer | Sergey Grebenshchikov <sgreben@gmail.com> | 2018-03-28 22:15:08 +0200 |
commit | 3cb5e051644e65899ae426d5c596282257dbb222 (patch) | |
tree | 286bc7168bba6a3d6ccf7b36d4e842a61d0bab70 | |
parent | 4afabeedf5e0ad5971c8147b63f9ce002a170cc9 (diff) |
Use exact min/max for X axis range1.1.1
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | pkg/plot/linechart.go | 3 | ||||
-rw-r--r-- | pkg/plot/scatterchart.go | 2 |
4 files changed, 7 insertions, 12 deletions
@@ -1,4 +1,4 @@ -VERSION = 1.1.0 +VERSION = 1.1.1 APP := jp PACKAGES := $(shell go list -f {{.Dir}} ./...) @@ -31,16 +31,16 @@ Or [download the binary](https://github.com/sgreben/jp/releases/latest) from the ```bash # Linux -curl -LO https://github.com/sgreben/jp/releases/download/1.1.0/jp_1.1.0_linux_x86_64.zip -unzip jp_1.1.0_linux_x86_64.zip +curl -LO https://github.com/sgreben/jp/releases/download/1.1.1/jp_1.1.1_linux_x86_64.zip +unzip jp_1.1.1_linux_x86_64.zip # OS X -curl -LO https://github.com/sgreben/jp/releases/download/1.1.0/jp_1.1.0_osx_x86_64.zip -unzip jp_1.1.0_osx_x86_64.zip +curl -LO https://github.com/sgreben/jp/releases/download/1.1.1/jp_1.1.1_osx_x86_64.zip +unzip jp_1.1.1_osx_x86_64.zip # Windows -curl -LO https://github.com/sgreben/jp/releases/download/1.1.0/jp_1.1.0_windows_x86_64.zip -unzip jp_1.1.0_windows_x86_64.zip +curl -LO https://github.com/sgreben/jp/releases/download/1.1.1/jp_1.1.1_windows_x86_64.zip +unzip jp_1.1.1_windows_x86_64.zip ``` ## Use it diff --git a/pkg/plot/linechart.go b/pkg/plot/linechart.go index f3c47f1..25468b9 100644 --- a/pkg/plot/linechart.go +++ b/pkg/plot/linechart.go @@ -97,11 +97,8 @@ func minMax(data *DataTable) (minX, maxX, minY, maxY float64) { minY = math.Min(minY, r[1]) } - xRange := maxX - minX yRange := maxY - minY - minX = roundDownToPercentOfRange(minX, xRange) minY = roundDownToPercentOfRange(minY, yRange) - maxX = roundUpToPercentOfRange(maxX, xRange) maxY = roundUpToPercentOfRange(maxY, yRange) return } diff --git a/pkg/plot/scatterchart.go b/pkg/plot/scatterchart.go index 85de1f3..038b814 100644 --- a/pkg/plot/scatterchart.go +++ b/pkg/plot/scatterchart.go @@ -51,9 +51,7 @@ func (c *ScatterChart) Draw(data *DataTable) string { } x := int((point[0]-minX)*scaleX + float64((paddingX+1)*c.RuneSize().Width)) y := int((point[1]-minY)*scaleY + float64(paddingY*c.RuneSize().Height)) - c.Set(y, x) - } c.drawAxes(paddingX, paddingY, minX, maxX, minY, maxY) |