Hello,
I am still trying out the different options given by gmt.jl, and i found it impossible to add a transparent layer to a png image.
If we take the “example” at https://github.com/GenericMappingTools/GMT.jl/issues/365 , i get the following code :
Summary
using GMT
f = Array{Float32}(undef,181,361)
for j in 1:181
for i in 1:361
f[j,i] = sin(pi*(j-1.0)/180.0)cos(4pi(i-1.0)/180)
end
end
G = GMT.mat2grid(f, x=0:360.0, y=-90.0:90);
mycmap = makecpt(color=“blue@100,white@50,red”, range=(-1.0,1.0,0.1), continuous=true)
coast(region=:g,proj=:Winkel,frame=:a,land=:gray)
grdimage!(G,cmap=mycmap,dpi=200,t=50,fmt=:png,show=true)
However, it always result in an error :
Summary
GPL Ghostscript 9.25: **** Could not open temporary file ‘’
**** Unable to open the initial device, quitting.
psconvert [ERROR]: System call [@“C:\Program Files\gs\gs9.25\bin\gswin64c.exe” -q -dNOPAUSE -dBATCH -dNOSAFER -dPDFSETTINGS=/prepress -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -dUseFlateCompression=true -dEmbedAllFonts=true -dSubsetFonts=true -dMonoImageFilter=/FlateEncode -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dSCANCONVERTERTYPE=2 -dALLOWPSTRANSPARENCY -dMaxBitmap=2147483647 -dUseFastColor=true -dGraphicsAlphaBits=1 -dTextAlphaBits=1 -sDEVICE=pdfwrite -g1601x1032 -r300 -sOutputFile=“C:\Users\Hao\AppData\Local\Temp\GMTjl_tmp_intermediate.pdf” “./psconvert_53412d.eps”] returned error 1.
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 78
Stacktrace:
[1] error(::String, ::Int32) at .\error.jl:42
[2] gmt(::String) at C:\Users\Hao.julia\packages\GMT\oeYJl\src\gmt_main.jl:241
[3] showfig(::Dict{Symbol,Any}, ::String, ::String, ::String, ::Bool, ::String) at C:\Users\Hao.julia\packages\GMT\oeYJl\src\common_options.jl:2532
[4] finish_PS_module(::Dict{Symbol,Any}, ::String, ::String, ::Bool, ::Bool, ::Bool, ::GMT.GMTgrid, ::Vararg{Any,N} where N) at C:\Users\Hao.julia\packages\GMT\oeYJl\src\common_options.jl:2633
[5] grdimage(::String, ::GMT.GMTgrid, ::Nothing, ::Nothing; first::Bool, kwargs::Base.Iterators.Pairs{Symbol,Any,NTuple{5,Symbol},NamedTuple{(:cmap, :dpi, :t, :fmt, :show),Tuple{GMT.GMTcpt,Int64,Int64,Symbol,Bool}}}) at C:\Users\Hao.julia\packages\GMT\oeYJl\src\grdimage.jl:107
[6] #grdimage!#114 at C:\Users\Hao.julia\packages\GMT\oeYJl\src\grdimage.jl:142 [inlined]
[7] top-level scope at H:\netcdf\donnée par année\trans.jl:14
[8] include(::Module, ::String) at .\Base.jl:377
[9] exec_options(::Base.JLOptions) at .\client.jl:288
[10] _start() at .\client.jl:484
in expression starting at H:\netcdf\donnée par année\trans.jl:14
But if is set the format as fmt=:ps, i do get both map, which i can manually set the transparency of the heatmap layer and get the correct result.
Regards