Open DanDeepPhase opened 2 years ago
That's not quite what's happening. Neither of them is a tuple.
julia> using Unitful
julia> x = (0:180)u"°";
julia> y = [0:180]u"°";
x
is a StepRange
, the same as 0u"°":1u"°":180u"°"
. That's why plotting it works. y
is a Vector
with a single element, which in turn is a StepRange
.
But yes, it's strange that plot(cos, [x, 2x])
doesn't use the recipe, we'll have to look at that.
In fact plot(cos, [x 2x])
also fails, strangely.
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.