diff --git a/src/plots/cartesian/axes.js b/src/plots/cartesian/axes.js index b84e49be255..0c83a476ffa 100644 --- a/src/plots/cartesian/axes.js +++ b/src/plots/cartesian/axes.js @@ -1759,7 +1759,9 @@ axes.drawOne = function(gd, ax, opts) { transFn: transFn }); - tickSubplots = Object.keys(ax._linepositions || {}); + if(ax.mirror === 'allticks') { + tickSubplots = Object.keys(ax._linepositions || {}); + } } for(i = 0; i < tickSubplots.length; i++) { diff --git a/test/image/baselines/mirror-all-vs-allticks.png b/test/image/baselines/mirror-all-vs-allticks.png new file mode 100644 index 00000000000..29310b03d5c Binary files /dev/null and b/test/image/baselines/mirror-all-vs-allticks.png differ diff --git a/test/image/mocks/mirror-all-vs-allticks.json b/test/image/mocks/mirror-all-vs-allticks.json new file mode 100644 index 00000000000..d48df50b5db --- /dev/null +++ b/test/image/mocks/mirror-all-vs-allticks.json @@ -0,0 +1,57 @@ +{ + "data": [ + { + "x": [1, 2, 3], + "y": [4, 5, 6] + }, + { + "x": [20, 30, 40], + "y": [50, 60, 70], + "xaxis": "x2" + }, + { + "x": [1, 2, 3], + "y": [4, 5, 6], + "yaxis": "y2" + }, + { + "x": [20, 30, 40], + "y": [50, 60, 70], + "xaxis": "x2", + "yaxis": "y2" + } + ], + "layout": { + "showlegend": false, + "grid": { + "rows": 2, + "columns": 2 + }, + "xaxis": { + "title": {"text": "mirror:all"}, + "ticks": "outside", + "showline": true, + "mirror": "all" + }, + "xaxis2": { + "title": {"text": "mirror:allticks"}, + "ticks": "outside", + "showline": true, + "mirror": "allticks" + }, + "yaxis": { + "title": {"text": "mirror:all"}, + "ticks": "outside", + "showline": true, + "zeroline": false, + "mirror": "all" + }, + "yaxis2": { + "title": {"text": "mirror:allticks"}, + "ticks": "outside", + "showline": true, + "zeroline": false, + "mirror": "allticks" + } + } +}