Skip to content

Commit 91a1cde

Browse files
committed
Fix grid location on manual ticks.
Previously, when manually setting tick positions, the gridlines would not follow, and instead remain at auto-detection positions, or maybe some other arbitrary-seeming positions. This fixes it. Disclaimer: this was co-developed with gpt-5.1-codex, which identified the issue and proposed the fix, I tested and simplified its code a bit.
1 parent 3aad00b commit 91a1cde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/axis.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ function mpld3_Axis(ax, props) {
8282
}
8383

8484
mpld3_Axis.prototype.getGrid = function() {
85+
this.filter_ticks(this.scale.domain());
8586
var gridprop = {
8687
nticks: this.props.nticks,
8788
zorder: this.props.zorder,
88-
tickvalues: null,
89+
tickvalues: this.props.filtered_tickvalues ?? this.props.tickvalues,
8990
xy: this.props.xy
9091
}
9192
if (this.props.grid) {

0 commit comments

Comments
 (0)