Skip to content

Commit eda678d

Browse files
proper fix for top/right axes
1 parent f83fb55 commit eda678d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/plots/cartesian/axes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,10 @@ axes.doTicks = function(gd, axid, skipTitle) {
21072107

21082108
if(!ax._marginPush || ax._marginPush < marginPush) {
21092109
ax._marginPush = marginPush;
2110-
var pushParams = {x: 0, y: 0, r: 0, l: 0, t: 0, b: 0};
2110+
var pushParams = {
2111+
x: ax.side[0] === 'r' ? 1 : 0,
2112+
y: ax.side[0] === 't' ? 1 : 0,
2113+
r: 0, l: 0, t: 0, b: 0};
21112114
pushParams[ax.side[0]] = marginPush;
21122115
Plots.autoMargin(gd, ax._name, pushParams);
21132116
}

test/image/mocks/long_axis_labels.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"short label 1", "loooooong label 1",
77
"short label 2", "loooooong label 2",
88
"short label 3", "loooooong label 3",
9-
"short label 4", "loooooong label 4",
9+
"short label 4", "loooooongloooooongloooooong label 4",
1010
"short label 5", "loooooong label 5"
1111
],
1212
"y": [
@@ -22,7 +22,7 @@
2222
"type": "scatter",
2323
"name": "loooooong y",
2424
"x":["looooooooooooonger"],
25-
"y":["loooooonger"]
25+
"y":["loooooooo"]
2626
}
2727
],
2828
"layout": {
@@ -31,7 +31,7 @@
3131
"yaxis2": {
3232
"title": "Y2 Axis Title",
3333
"overlaying": "y",
34-
"side": "right"
34+
"side": "right", "titlefont": {"size": 40}
3535
}
3636
}
3737
}

0 commit comments

Comments
 (0)