You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing lists from iterators, tuple and vectors yield different levels of wrapped data, which then gets differently ustripped when plotting. I personally find this tricky in Plots because I'm always putting tuples where vectors belong and vice versa.
using Plots
using Unitful, Unitful.DefaultSymbols, UnitfulRecipes
plot(cos,(0:180)°,label="Tuple")
plot!(cos,[0:180]°,label="Vector")
The vector comprehension ends up [(0:180)°] which then gets stripped to 0:180, whereas the Tuple version forms (0:180)° which uses degree math. So, the Tuple goes through half a rotation, and the Vector goes through 180 rotations.
The text was updated successfully, but these errors were encountered:
When constructing lists from iterators, tuple and vectors yield different levels of wrapped data, which then gets differently ustripped when plotting. I personally find this tricky in Plots because I'm always putting tuples where vectors belong and vice versa.
The vector comprehension ends up [(0:180)°] which then gets stripped to 0:180, whereas the Tuple version forms (0:180)° which uses degree math. So, the Tuple goes through half a rotation, and the Vector goes through 180 rotations.
The text was updated successfully, but these errors were encountered: