We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b8662e commit f7c8a07Copy full SHA for f7c8a07
examples/units.py
@@ -50,20 +50,20 @@
50
51
xconv = FuncEdge.from_func(
52
"xconv",
53
- lambda x, xunits: x.to(xunits),
+ lambda x, xunits: x.to(xunits).magnitude,
54
{"x": unit_vector, "xunits": scalar},
55
{"x": Desc(("N",), "data")},
56
)
57
yconv = FuncEdge.from_func(
58
"yconv",
59
- lambda y, yunits: y.to(yunits),
+ lambda y, yunits: y.to(yunits).magnitude,
60
{"y": unit_vector, "yunits": scalar},
61
{"y": Desc(("N",), "data")},
62
63
lw = Line(cont, [xconv, yconv])
64
65
ax.add_artist(lw)
66
-nax.xaxis.set_units(ureg.m)
67
-nax.yaxis.set_units(ureg.cm)
+nax.xaxis.set_units(ureg.ft)
+nax.yaxis.set_units(ureg.m)
68
69
plt.show()
0 commit comments