diff --git a/src/GMT.jl b/src/GMT.jl index 40bc7b0d61..78d498a57b 100644 --- a/src/GMT.jl +++ b/src/GMT.jl @@ -23,6 +23,7 @@ global current_view = nothing # To store the current viewpoint (-p) global multi_col = false # To allow plottig multiple columns at once global IamModern = false # To know if we are in modern mode global IamSubplot = false # To know if we are in subplot mode +global usedConfPar = false # Hacky solution for the session's memory trouble const FMT = "ps" const def_fig_size = "12c/8c" # Default fig size for plot like programs const def_fig_axes = " -Baf -BWSen" # Default fig axes for plot like programs diff --git a/src/common_options.jl b/src/common_options.jl index fecd411a66..b7ff5112cb 100644 --- a/src/common_options.jl +++ b/src/common_options.jl @@ -686,8 +686,8 @@ function parse_common_opts(d, cmd, opts, first=true) end if (opt_p !== nothing) # Restrict the contents of this block to when -p was used if (opt_p != "") - if (opt_p == "none") current_view = nothing - else current_view = opt_p + if (opt_p == " -pnone") current_view = nothing; cmd = cmd[1:end-7]; opt_p = "" + else current_view = opt_p end elseif (!first && current_view !== nothing) cmd *= current_view @@ -763,6 +763,7 @@ function parse_params(cmd::String, d::Dict) elseif (isa(val, Tuple)) cmd *= " --" * string(val[1]) * "=" * string(val[2]) end + global usedConfPar = true end return cmd end @@ -2127,6 +2128,7 @@ function showfig(d::Dict, fname_ps::String, fname_ext::String, opt_T::String, K= out = mv(out, fname, force=true) end elseif (fname_ps != "") + if (K) gmt("psxy -T -R0/1/0/1 -JX1 -O >> " * fname_ps) end # Close the PS file first out = fname_ps if (fname != "") out = mv(out, fname, force=true) @@ -2177,6 +2179,7 @@ function finish_PS_module(d::Dict, cmd, opt_extra::String, output::String, fname if ((r = dbg_print_cmd(d, cmd)) !== nothing) return r end # For tests only global img_mem_layout = add_opt("", "", d, [:layout]) + global usedConfPar if (isa(cmd, Array{String, 1})) for k = 1:length(cmd) @@ -2188,6 +2191,11 @@ function finish_PS_module(d::Dict, cmd, opt_extra::String, output::String, fname digests_legend_bag(d) # Plot the legend if requested + if (usedConfPar) # Hacky shit to force start over when --PAR options were use + usedConfPar = false + gmt("destroy") + end + fname = "" if (haskey(d, :savefig)) # Also ensure that file has the right extension fname, ext = splitext(d[:savefig]) diff --git a/src/psxy.jl b/src/psxy.jl index 1304d0606a..b505f923a2 100644 --- a/src/psxy.jl +++ b/src/psxy.jl @@ -338,6 +338,8 @@ function get_marker_name(d::Dict, symbs, is3D, del=false, arg1=nothing) if (t == "-" || t == "x-dash") marca = "-" elseif (t == "+" || t == "plus") marca = "+" elseif (t == "a" || t == "*" || t == "star") marca = "a" + elseif (t == "k" || t == "custom") marca = "k" + elseif (t == "x" || t == "cross") marca = "x" elseif (t[1] == 'c' || t[1] == 'C') marca = "c" elseif (t == "d" || t == "diamond") marca = "d" elseif (t == "g" || t == "octagon") marca = "g" @@ -349,7 +351,6 @@ function get_marker_name(d::Dict, symbs, is3D, del=false, arg1=nothing) elseif (t == "s" || t == "square") marca = "s" elseif (t == "t" || t == "^" || t == "triangle") marca = "t" elseif (t == "T" || t == "Triangle") marca = "T" - elseif (t == "x" || t == "cross") marca = "x" elseif (is3D && (t == "u" || t == "cube")) marca = "u" elseif (t == "y" || t == "y-dash") marca = "y" end