Skip to content

Commit

Permalink
avoid log 0
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Jul 26, 2019
1 parent 38cd9e2 commit 765ca5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 765ca5a

Please sign in to comment.