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) {
104104 height = yref ? Math . abs ( yref . l2p ( d . sizey ) - yref . l2p ( 0 ) ) : d . sizey * size . h ;
105105
106106 // 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 ;
109109
110110 var sizing = anchors . x [ d . xanchor ] . sizing + anchors . y [ d . yanchor ] . sizing ;
111111
112112 // 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 ;
115115
116116
117117 // Construct the proper aspectRatio attribute
Original file line number Diff line number Diff line change 33 {
44 "x" : [1 ,2 ,3 ],
55 "y" : [1 ,2 ,3 ]
6+ }, {
7+ "x" : [1 ,2 ,3 ],
8+ "y" : [1 ,2 ,3 ],
9+ "yaxis" : " y2"
610 }
711 ],
812 "layout" : {
13+ "yaxis" : {
14+ "domain" : [0 , 0.5 ]
15+ },
16+ "yaxis2" : {
17+ "domain" : [0.5 , 1 ]
18+ },
919 "images" : [
1020 {
1121 "source" : " https://images.plot.ly/language-icons/api-home/python-logo.png" ,
3242 {
3343 "source" : " https://images.plot.ly/language-icons/api-home/r-logo.png" ,
3444 "xref" : " x" ,
35- "yref" : " y " ,
45+ "yref" : " y2 " ,
3646 "x" : 1 ,
3747 "y" : 3 ,
3848 "sizex" : 2 ,
You can’t perform that action at this time.
0 commit comments