File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,14 @@ module.exports = function draw(gd) {
104
104
height = yref ? Math . abs ( yref . l2p ( d . sizey ) - yref . l2p ( 0 ) ) : d . sizey * size . h ;
105
105
106
106
// Offsets for anchor positioning
107
- var xOffset = width * anchors . x [ d . xanchor ] . offset + size . l ,
108
- yOffset = height * anchors . y [ d . yanchor ] . offset + size . t ;
107
+ var xOffset = width * anchors . x [ d . xanchor ] . offset ,
108
+ yOffset = height * anchors . y [ d . yanchor ] . offset ;
109
109
110
110
var sizing = anchors . x [ d . xanchor ] . sizing + anchors . y [ d . yanchor ] . sizing ;
111
111
112
112
// Final positions
113
- var xPos = ( xref ? xref . l2p ( d . x ) : d . x * size . w ) + xOffset ,
114
- yPos = ( yref ? yref . l2p ( d . y ) : size . h - d . y * size . h ) + yOffset ;
113
+ var xPos = ( xref ? xref . l2p ( d . x ) + xref . _offset : d . x * size . w + size . l ) + xOffset ,
114
+ yPos = ( yref ? yref . l2p ( d . y ) + yref . _offset : size . h - d . y * size . h + size . t ) + yOffset ;
115
115
116
116
117
117
// Construct the proper aspectRatio attribute
Original file line number Diff line number Diff line change 3
3
{
4
4
"x" : [1 ,2 ,3 ],
5
5
"y" : [1 ,2 ,3 ]
6
+ }, {
7
+ "x" : [1 ,2 ,3 ],
8
+ "y" : [1 ,2 ,3 ],
9
+ "yaxis" : " y2"
6
10
}
7
11
],
8
12
"layout" : {
13
+ "yaxis" : {
14
+ "domain" : [0 , 0.5 ]
15
+ },
16
+ "yaxis2" : {
17
+ "domain" : [0.5 , 1 ]
18
+ },
9
19
"images" : [
10
20
{
11
21
"source" : " https://images.plot.ly/language-icons/api-home/python-logo.png" ,
32
42
{
33
43
"source" : " https://images.plot.ly/language-icons/api-home/r-logo.png" ,
34
44
"xref" : " x" ,
35
- "yref" : " y " ,
45
+ "yref" : " y2 " ,
36
46
"x" : 1 ,
37
47
"y" : 3 ,
38
48
"sizex" : 2 ,
You can’t perform that action at this time.
0 commit comments