I made this helper function a while back to display images using Gadfly:
function imshow(x, title::String="", units::String="", args...)
is, js, values = findnz(x)
m, n = size(x)
df = DataFrames.DataFrame(i=is, j=js, value=values)
plot(df, x="j", y="i", color="value",
Coord.c
There's also contour plots
using Gadfly
plot(layer(x=xgrid, y=ygrid, z=functionvalues, Geom.contour))
Nope, you can also use rectangular pixels:
using Gadfly
Xmin = Float64[]
Xmax = Float64[]
Ymin = Float64[]
Ymax = Float64[]
Z = Float64[]
for x in 1:2:30, y in 1:20
push!(Xmin,x-1)
push!(Ymin,y-0.5)
push!(Xmax,x+1)
push!(Ymax,y+0.5)
push!(Z,x*y)
end
plot(x_min=Xmin, x_max=Xm
But Geom.rectbin seems to only work for square arrays, which is a severe
limitation.
On Saturday, February 7, 2015 at 12:44:26 AM UTC+1, Iain Dunning wrote:
>
> How about:
>
> using Gadfly
> # Generate some data
> N = 100
> X = Float64[]
> Y = Float64[]
> Z = Float64[]
> for x in linspace(0.0,2π,
How about:
using Gadfly
# Generate some data
N = 100
X = Float64[]
Y = Float64[]
Z = Float64[]
for x in linspace(0.0,2π,N), y in linspace(0.0,2π,N)
push!(X, x)
push!(Y, y)
push!(Z, sin(x)*sin(y))
end
plot(x=X,y=Y,color=Z,Geom.rectbin)
On Friday, February 6, 2015 at 5:34:45 PM UTC-5,