Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f0eea15

Browse files
committedJan 7, 2015
update _add_domain (accepts layout not fig)
1 parent 7463f60 commit f0eea15

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

‎plotly/tools.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -863,22 +863,21 @@ def _get_anchors(r, c, x_cnt, y_cnt, shared_xaxes, shared_yaxes):
863863

864864
return x_anchor, y_anchor
865865

866-
# Function pasting x/y domains in fig object (2d case)
867-
def _add_domain(fig, x_or_y, label, domain, anchor, position):
866+
# Function pasting x/y domains in layout object (2d case)
867+
def _add_domain(layout, x_or_y, label, domain, anchor, position):
868868
name = label[0] + 'axis' + label[1:]
869869
graph_obj = '{X_or_Y}Axis'.format(X_or_Y=x_or_y.upper())
870870
axis = getattr(graph_objs, graph_obj)(domain=domain)
871871
if anchor:
872872
axis['anchor'] = anchor
873873
if position: # N.B. No need to add position == 0 to axis
874874
axis['position'] = position
875-
fig['layout'][name] = axis
875+
layout[name] = axis
876876

877-
# Function pasting x/y domains in fig object (3d case)
878-
def _add_domain_is_3d(fig, s_cnt, x_domain, y_domain):
879-
scene_name = "scene{s_cnt}".format(s_cnt=s_cnt)
877+
# Function pasting x/y domains in layout object (3d case)
878+
def _add_domain_is_3d(layout, s_label, x_domain, y_domain):
880879
scene = graph_objs.Scene(domain={'x': x_domain, 'y': y_domain})
881-
fig['layout'][scene_name] = scene
880+
layout[s_label] = scene
882881

883882
x_cnt = y_cnt = s_cnt = 1 # subplot axis/scene counters
884883

0 commit comments

Comments
 (0)
Please sign in to comment.