function plot_fft, x, y, z, xname, yname, plot_title, file_name ;---------- ;Help ;---------- ;Function for plotting a contour plot map of 3D data and writing the result to .PNG file. ;---------- ;Variable preparation ;---------- x = double(x) y = double(y) z = double(z) xname = string(xname) yname = string(yname) plot_title = string(plot_title) file_name = string(file_name) n_level = 30L level_vec = 1d-4*(exp(8d*dindgen(n_level)/double(n_level))-1d) ;---------- ;Plotting and exporting to PNG ;---------- set_plot, 'z' device, set_pixel_depth = 24, decomposed = 0, z_buffering = 0 loadct,39 !P.color=0 !P.background=255 contour, z, x, y, levels = level_vec, xrange = [min(x), max(x)], yrange = [min(y),max(y)], xstyle = 1, ystyle = 1, xtitle = xname, ytitle = yname, title = plot_title, /fill contour, z, x, y, levels = level_vec, xrange = [min(x), max(x)], yrange = [min(y),max(y)], xstyle = 1, ystyle = 1, xtitle = xname, ytitle = yname, title = plot_title, /overplot write_png, file_name+'.png', tvrd(true=1) device, /close ;---------- ;Finalisation ;---------- end