Skip to content

Commit d5f2c7b

Browse files
committed
support rotation of axis titles
1 parent ac5daca commit d5f2c7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

matplotlib2tikz/axes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ def __init__(self, data, obj):
4242

4343
# get axes titles
4444
xlabel = obj.get_xlabel()
45+
xrotation = obj.xaxis.get_label().get_rotation()
4546
if xlabel:
4647
xlabel = mpl_backend_pgf.common_texification(xlabel)
4748
self.axis_options.append(u"xlabel={{{}}}".format(xlabel))
49+
if xrotation != 0.0:
50+
self.axis_options.append(u"xlabel style={{rotate={}}}".format(xrotation - 90))
4851
ylabel = obj.get_ylabel()
52+
yrotation = obj.yaxis.get_label().get_rotation()
4953
if ylabel:
5054
ylabel = mpl_backend_pgf.common_texification(ylabel)
5155
self.axis_options.append(u"ylabel={{{}}}".format(ylabel))
56+
if yrotation != 0.0:
57+
self.axis_options.append(u"ylabel style={{rotate={}}}".format(yrotation - 90))
5258

5359
# Axes limits.
5460
# Sort the limits so make sure that the smaller of the two is actually *min.

0 commit comments

Comments
 (0)