Skip to content

Commit 78cb240

Browse files
committed
Python 2.6 fix for '{}' -> '{0}'
1 parent 4240335 commit 78cb240

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

plotly/matplotlylib/renderer.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ def open_axes(self, ax, props):
138138
self.axis_ct += 1
139139
# set defaults in axes
140140
xaxis = XAxis(
141-
anchor='y{}'.format(self.axis_ct),
141+
anchor='y{0}'.format(self.axis_ct),
142142
zeroline=False,
143143
ticks='inside')
144144
yaxis = YAxis(
145-
anchor='x{}'.format(self.axis_ct),
145+
anchor='x{0}'.format(self.axis_ct),
146146
zeroline=False,
147147
ticks='inside')
148148
# update defaults with things set in mpl
@@ -163,8 +163,8 @@ def open_axes(self, ax, props):
163163

164164

165165
# put axes in our figure
166-
self.plotly_fig['layout']['xaxis{}'.format(self.axis_ct)] = xaxis
167-
self.plotly_fig['layout']['yaxis{}'.format(self.axis_ct)] = yaxis
166+
self.plotly_fig['layout']['xaxis{0}'.format(self.axis_ct)] = xaxis
167+
self.plotly_fig['layout']['yaxis{0}'.format(self.axis_ct)] = yaxis
168168

169169
def close_axes(self, ax):
170170
"""Close the axes object and clean up.
@@ -214,8 +214,8 @@ def draw_bar(self, patch_coll):
214214
bar = Bar(orientation=orientation,
215215
x=x,
216216
y=y,
217-
xaxis='x{}'.format(self.axis_ct),
218-
yaxis='y{}'.format(self.axis_ct),
217+
xaxis='x{0}'.format(self.axis_ct),
218+
yaxis='y{0}'.format(self.axis_ct),
219219
opacity=patch_coll[0]['alpha'],
220220
marker=Marker(
221221
color=patch_coll[0]['facecolor'],
@@ -297,8 +297,8 @@ def draw_marked_line(self, **props):
297297
name=props['label'],
298298
x=[xy_pair[0] for xy_pair in props['data']],
299299
y=[xy_pair[1] for xy_pair in props['data']],
300-
xaxis='x{}'.format(self.axis_ct),
301-
yaxis='y{}'.format(self.axis_ct),
300+
xaxis='x{0}'.format(self.axis_ct),
301+
yaxis='y{0}'.format(self.axis_ct),
302302
line=line,
303303
marker=marker)
304304
self.plotly_fig['data'] += marked_line,
@@ -528,12 +528,12 @@ def draw_text(self, **props):
528528
"coordinates\n"
529529
x, y = props['position']
530530
axis_ct = self.axis_ct
531-
xaxis = self.plotly_fig['layout']['xaxis{}'.format(axis_ct)]
532-
yaxis = self.plotly_fig['layout']['yaxis{}'.format(axis_ct)]
531+
xaxis = self.plotly_fig['layout']['xaxis{0}'.format(axis_ct)]
532+
yaxis = self.plotly_fig['layout']['yaxis{0}'.format(axis_ct)]
533533
if (xaxis['range'][0] < x < xaxis['range'][1]
534534
and yaxis['range'][0] < y < yaxis['range'][1]):
535-
xref = 'x{}'.format(self.axis_ct)
536-
yref = 'y{}'.format(self.axis_ct)
535+
xref = 'x{0}'.format(self.axis_ct)
536+
yref = 'y{0}'.format(self.axis_ct)
537537
else:
538538
self.msg += " Text object is outside " \
539539
"plotting area, making 'paper' reference.\n"
@@ -645,7 +645,7 @@ def draw_xlabel(self, **props):
645645
646646
"""
647647
self.msg += " Adding xlabel\n"
648-
axis_key = 'xaxis{}'.format(self.axis_ct)
648+
axis_key = 'xaxis{0}'.format(self.axis_ct)
649649
self.plotly_fig['layout'][axis_key]['title'] = props['text']
650650
titlefont = Font(size=props['style']['fontsize'],
651651
color=props['style']['color'])
@@ -675,7 +675,7 @@ def draw_ylabel(self, **props):
675675
676676
"""
677677
self.msg += " Adding ylabel\n"
678-
axis_key = 'yaxis{}'.format(self.axis_ct)
678+
axis_key = 'yaxis{0}'.format(self.axis_ct)
679679
self.plotly_fig['layout'][axis_key]['title'] = props['text']
680680
titlefont = Font(size=props['style']['fontsize'],
681681
color=props['style']['color'])

0 commit comments

Comments
 (0)