Skip to content

Commit 195dfa5

Browse files
committed
Fix various errata/typos
1 parent aca7a92 commit 195dfa5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,10 @@ axes.calcTicks = function calcTicks(ax, opts) {
951951
} else {
952952
axes.prepTicks(mockAx, opts);
953953
}
954-
954+
955955
if(mockAx.tickmode === 'full domain'){
956-
nt = mockAx.nticks; // does mockAx have nitkcs?
956+
var nt = mockAx.nticks; // does mockAx have nitkcs?
957+
if(nt === undefined) nt = 0;
957958
var tickVals = [];
958959
if (nt == 0) {
959960
// pass
@@ -962,10 +963,10 @@ axes.calcTicks = function calcTicks(ax, opts) {
962963
} else if (nt == 2) {
963964
tickVals = [0, 1];
964965
} else {
965-
var increment = 1/(nt-2);
966+
var increment = 1/(nt-1); // (nt-2) + 1
966967
tickVals.push(0);
967968
for (let i = 0; i < nt-2; i++) {
968-
tickVals.push((i+1)*incremente);
969+
tickVals.push((i+1)*increment);
969970
}
970971
tickVals.push(1);
971972
}

0 commit comments

Comments
 (0)