Skip to content

Commit

Permalink
Merge pull request #4140 from plotly/mirror-all-not-mirror-allticks
Browse files Browse the repository at this point in the history
Don't draw ticks on tick subplots when mirror:'all'
  • Loading branch information
etpinard authored Aug 21, 2019
2 parents 508b1c9 + cc19178 commit 2aec9ef
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions test/image/mocks/mirror-all-vs-allticks.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 2aec9ef

Please sign in to comment.