Skip to content

Commit dfa6f38

Browse files
author
Tino Michael
committed
drawing no longer breaks if data contain astropy quantities
1 parent 66da89d commit dfa6f38

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

matplotlib2tikz/line2d.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ def draw_line2d(data, obj):
144144
else:
145145
content.append('%.15g %.15g\n' % (x, y))
146146
else:
147+
try:
148+
xdata = xdata.value
149+
except AttributeError:
150+
pass
151+
try:
152+
ydata = ydata.value
153+
except AttributeError:
154+
pass
147155
for (x, y) in zip(xdata, ydata):
148156
content.append('%.15g %.15g\n' % (x, y))
149157
content.append('};\n')

0 commit comments

Comments
 (0)