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π,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, Andrei Berceanu wrote:
>>
>> The only thing keeping me from migrating from PyPlot to Gadfly is the
>> lack of 2D plotting abilities. To exemplify, I used the following code to
>> generate the attached image with PyPlot (here data is a 2d array):
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *fig, ax = plt.subplots(figsize=(4, 4))img = ax[:imshow](data,
>> origin="upper", ColorMap("hot"),
>> interpolation="none",
>> extent=[x[1], x[end], x[1], x[end]]) ax[:set_ylim](x[1],
>> x[end]) ax[:set_xlim](x[1],
>> x[end]) ax[:set_xlabel](L"$p_x$") ax[:set_ylabel](L"$p_y$") tks = [-3.,
>> -1.5, 0, 1.5,
>> 3.] ax[:xaxis][:set_ticks](tks) ax[:yaxis][:set_ticks](tks) cbar =
>> fig[:colorbar](img, shrink=0.8, aspect=20,
>> fraction=.12,pad=.02) cbar[:ax][:tick_params](labelsize=7)
>> fig[:savefig]("fig_berry_bz",
>> bbox_inches="tight")*
>>
>> What is the current alternative for obtaining such a plot using Gadfly?
>> Are there plans for getting similar functionality anytime soon?
>>
>