From 765ca5a62b88eb94bf64dfe32f1eb364d5aff0cb Mon Sep 17 00:00:00 2001 From: archmoj Date: Fri, 26 Jul 2019 11:07:16 -0400 Subject: [PATCH] avoid log 0 --- src/plots/cartesian/axes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plots/cartesian/axes.js b/src/plots/cartesian/axes.js index 423a856809c..30eaf41a153 100644 --- a/src/plots/cartesian/axes.js +++ b/src/plots/cartesian/axes.js @@ -839,7 +839,7 @@ function autoTickRound(ax) { // 2 digits past largest digit of dtick ax._tickround = 2 - Math.floor(Math.log(dtick) / Math.LN10 + 0.01); - var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1])); + var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1])) || 1; var rangeexp = Math.floor(Math.log(maxend) / Math.LN10 + 0.01); if(Math.abs(rangeexp) > 3) {