Thanks!
On Sunday, June 29, 2014 7:11:37 PM UTC, Johan Sigfrids wrote: > > Your giving Gadfly your data but you are not saying what you want Gadfly > to do with it. You need to specify a Geom for Gadfly to know what kind of > plot you want. For example: > > using Gadfly > output = [10.0, 10.4881, 10.9534, 11.3967, 11.8191, 12.2213, 12.6042, > 12.9687, 13.3156, 13.6458] > plot(x=1:10, y=output, Geom.line()) > > You may want to look at the Gadfly documentationat > http://dcjones.github.io/Gadfly.jl/ > > > On Sunday, June 29, 2014 9:53:55 PM UTC+3, Magnús Örn Gylfason wrote: >> >> Hi, >> >> Ive been reading the docs, but I've been missing something. >> >> I'm using Julia to implement a Solow growth model and want to use Gadfly >> to display the data. >> >> https://gist.github.com/mg/46ce2b972a42311ab520 >> >> The Run function accepts some parameters and returns an array containing >> the iteration. Now Im trying to display the array with Gadfly. >> >> output= Run(1.0,10.0,10.0,0.5,0.2,0.1,10) >> 10-element Array{Float64,1}: >> 10.0 >> 10.4881 >> 10.9534 >> 11.3967 >> 11.8191 >> 12.2213 >> 12.6042 >> 12.9687 >> 13.3156 >> 13.6458 >> >> plot(data::output) >> ERROR: type: typeassert: expected Type{T<:Top}, got Array{Float64,1} >> >> plot(output,0,10) >> Error showing value of type Plot: >> ERROR: type: apply_statistic: in apply, expected Function, got Float64 >> in apply_statistic at >> /Users/magnusorngylfason/.julia/v0.3/Gadfly/src/statistics.jl:992 >> in apply_statistics at >> /Users/magnusorngylfason/.julia/v0.3/Gadfly/src/statistics.jl:36 >> in render at >> /Users/magnusorngylfason/.julia/v0.3/Gadfly/src/Gadfly.jl:625 >> in display at >> /Users/magnusorngylfason/.julia/v0.3/Gadfly/src/Gadfly.jl:885 >> in display at >> /Users/magnusorngylfason/.julia/v0.3/Gadfly/src/Gadfly.jl:800 >> in print_response at REPL.jl:139 >> in print_response at REPL.jl:124 >> in anonymous at REPL.jl:551 >> >> plot(1:10, output) >> ERROR: no method plot(UnitRange{Int64}, Array{Float64,1}) >> >> plot(x=1:10, output[x]) >> ERROR: x not defined >> >> plot(x=1:10, output[1:10]) >> ERROR: no method plot(Array{Float64,1}) >> >> Can anyone tell me the correct syntax for calling plot with my output >> array? >> >> cheers, >> mg >> >
