Just to add my 2 cents: I posted a question about linspace and collect not too long ago. Collect wasn't obvious to me at first, and I tried something like linspace (0, 1, 10)[:] to get the array first. I only needed it for PyPlot. As long as PyPlot works with whatever linspace returns, I'm happy.
On Wednesday, September 30, 2015 at 11:56:23 AM UTC-7, Steven G. Johnson wrote: > > > > On Wednesday, September 30, 2015 at 1:31:55 PM UTC-4, Alex Ames wrote:\ >> >> I ran into errors when trying to plot a function over a linspace of x >> values, since plotting libs currently expect vectors as arguments, not >> range objects. Easily fixed if you know Julia well, but Matlab/Python >> converts may be stymied. >> > > PyPlot works fine with linspace arguments. > > In Julia, a Range is a subtype of AbstractVector, and any plotting program > should normally work for any AbstractVector type, not just Array. If not, > that is a bug in the plotting program. >