How to plot a 2D rotated array

An alternative working solution is to use pcolor() available within PyPlot.jl to produce a heatmap-like output for a 2D data array as function of 2D coordinate fields (which can be rotated or not):

using PyPlot
α      = 10.0
lx, ly = 300.0, 100.0
nx, ny = 61, 21
(xc, yc ) = (LinRange(-lx/2, lx/2, nx), LinRange(-ly/2, ly/2, ny))
(Xc2,Yc2) = ([x for x=xc,y=yc], [y for x=xc,y=yc])
(X2r,Y2r) = (Xc2*cosd(α) - sind(α)*Yc2, Xc2*sind(α) + cosd(α)*Yc2)
pcolor(X2r, Y2r, rand(nx,ny))

which will produce following output

Would be nice to have such capability within the Plots.jl environment. Any suggestion welcome.

2 Likes