OS: WIndows 10
Julia Version: 1.3.1
I tried to plot the original image and its 2D Fourier spectrum. Currently, the size of subplots is different. I have tried to change aspect ratio of each plot and also of subplot as well as making the plots of equal size and then subploting; but nothing works. I just wanted these two plots to appear in same size.
Unfortunately the colorbar affects aspect ratio. If you turn it off, you should get same size figures.
The downside is that there is no good way (I know of) to plot the colorbar separately. A hackish way is:
using Images, FFTW, Plots
img = load("test.png")
F = fftshift(fft(Float64.(Gray.(img))))
tf = log.(abs.(F.*F)).+1
imgdisp = plot(img, aspect_ratio=1, xlims=(1,size(img,2)), ylims=(1,size(img,1)))
fspec = heatmap(tf, aspect_ratio=1,colorbar=nothing, xlims=(1,size(tf,2)), ylims=(1,size(tf,1)), clims=extrema(tf) )
cbar = heatmap(minimum(tf).*ones(1,1), aspect_ratio=10000, left_margin=-5Plots.mm, right_margin=5Plots.mm, framestyle=:none, clims=extrema(tf) )
plot(imgdisp, fspec, cbar, layout = grid(1, 3, widths=[0.4 ,0.4, 0.2]) )