Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d79a28

Browse files
committed
convert gl2d and gl3d tick angles from deg to radians
1 parent b2f07f7 commit 5d79a28

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/plots/gl2d/convert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ proto.merge = function(options) {
123123

124124
this.tickEnable[i+j] = false;
125125
this.tickColor[i+j] = str2RGBArray((ax.tickfont || {}).color);
126-
this.tickAngle[i+j] = (ax.tickangle === 'auto') ? 0 : -ax.tickangle;
126+
this.tickAngle[i+j] = (ax.tickangle === 'auto') ?
127+
0 :
128+
Math.PI * -ax.tickangle / 180;
127129
this.tickPad[i+j] = this.getTickPad(ax);
128130

129131
this.tickMarkLength[i+j] = 0;

src/plots/gl3d/layout/convert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ proto.merge = function(sceneLayout) {
109109
if ('tickcolor' in axes) opts.lineTickColor[i] = str2RgbaArray(axes.tickcolor);
110110
if ('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth;
111111
if ('tickangle' in axes) {
112-
opts.tickAngle[i] = axes.tickangle === 'auto' ? 0 : axes.tickangle;
112+
opts.tickAngle[i] = (axes.tickangle === 'auto') ?
113+
0 :
114+
Math.PI * -axes.tickangle / 180;
113115
}
114116
//// tick labels
115117
if ('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels;

0 commit comments

Comments
 (0)