Skip to content

Commit 42298d0

Browse files
committed
unicode fix for python 2
Fixes #269.
1 parent 29a7177 commit 42298d0

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

matplotlib2tikz/axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ def __init__(self, data, obj):
3838
title = obj.get_title()
3939
data["current axis title"] = title
4040
if title:
41-
self.axis_options.append("title={{{}}}".format(title))
41+
self.axis_options.append(u"title={{{}}}".format(title))
4242

4343
# get axes titles
4444
xlabel = obj.get_xlabel()
4545
if xlabel:
4646
xlabel = mpl_backend_pgf.common_texification(xlabel)
47-
self.axis_options.append("xlabel={{{}}}".format(xlabel))
47+
self.axis_options.append(u"xlabel={{{}}}".format(xlabel))
4848
ylabel = obj.get_ylabel()
4949
if ylabel:
5050
ylabel = mpl_backend_pgf.common_texification(ylabel)
51-
self.axis_options.append("ylabel={{{}}}".format(ylabel))
51+
self.axis_options.append(u"ylabel={{{}}}".format(ylabel))
5252

5353
# Axes limits.
5454
# Sort the limits so make sure that the smaller of the two is actually

test/test_annotate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ def test():
3838

3939
if __name__ == "__main__":
4040
import helpers
41+
4142
# helpers.compare_mpl_latex(plot)
4243
helpers.print_tree(plot())

test/test_arrows.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ def to_texstring(s):
7171

7272
if __name__ == "__main__":
7373
import helpers
74+
7475
helpers.compare_mpl_latex(plot)
7576
# helpers.print_tree(plot())

test/test_basic_sin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ def test():
3030

3131
if __name__ == "__main__":
3232
import helpers
33+
3334
# helpers.compare_mpl_latex(plot)
3435
helpers.print_tree(plot())

test/test_fancybox.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,5 +205,6 @@ def test():
205205

206206
if __name__ == "__main__":
207207
import helpers
208+
208209
# helpers.compare_mpl_latex(plot)
209210
helpers.print_tree(plot())

0 commit comments

Comments
 (0)