@@ -70,19 +70,9 @@ function add_opt_module(d::Dict)::Vector{String}
7070 r = add_opt_module_barr2 (symb)
7171 elseif (symb == :colorbar && (isa (val, StrSymb)))
7272 # Accepts Top/TopTri[High|Low], Bottom/BottomTri, Left/LeftTri, Right/RightTri or triangles (caseless)
73- val_str:: String = lowercase (string (val))
7473 opt_RJ = ! IamModern[] ? CTRL. pocket_R[1 ] * " -J" : " "
75- anc = " RM" ; tris = " " # Default anchor Right Middle and no triangles
76- if (contains (val_str, " tri" ) && ! isempty (CURRENT_CPT[])) # Sets CPT.bfn to match colormap end colors
77- CURRENT_CPT[]. bfn[1 ,:] .= CURRENT_CPT[]. colormap[1 ,:]
78- CURRENT_CPT[]. bfn[2 ,:] .= CURRENT_CPT[]. colormap[end ,:]
79- tris = contains (val_str, " high" ) ? " +ef" : contains (val_str, " low" ) ? " +eb" : " +e"
80- end
81- if (! startswith (val_str, " tri" )) # Means that not just triangles were requested
82- t:: Char = val_str[1 ] # Accept "Top, Bot, Left" but default to Right
83- anc = (t == ' t' ) ? " TC" : (t == ' b' ? " BC" : (t == ' l' ? " LM" : " RM" ))
84- end
85- r = " psscale $opt_RJ -Baf -C -DJ" * anc * tris
74+ anc_tris = colorbar_triangles (val)
75+ r = " psscale $opt_RJ -Baf -C -DJ" * anc_tris
8676 elseif (symb == :clip )
8777 if (isa (val, String) || isa (val, Symbol)) # Accept also "land", "water" or "ocean" or DCW country codes(s) or a hard -E string
8878 _str:: String = string (val) # Shoot the Any
@@ -108,6 +98,23 @@ function add_opt_module(d::Dict)::Vector{String}
10898 return out
10999end
110100
101+ # ---------------------------------------------------------------------------------------------------
102+ function colorbar_triangles (val:: StrSymb ):: String
103+ # Accepts Top/TopTri[High|Low], Bottom/BottomTri, Left/LeftTri, Right/RightTri or triangles (caseless)
104+ val_str:: String = lowercase (string (val))
105+ anc = " RM" ; tris = " " # Default anchor Right Middle and no triangles
106+ if (contains (val_str, " tri" ) && ! isempty (CURRENT_CPT[])) # Sets CPT.bfn to match colormap end colors
107+ CURRENT_CPT[]. bfn[1 ,:] .= CURRENT_CPT[]. colormap[1 ,:]
108+ CURRENT_CPT[]. bfn[2 ,:] .= CURRENT_CPT[]. colormap[end ,:]
109+ tris = contains (val_str, " high" ) ? " +ef" : contains (val_str, " low" ) ? " +eb" : " +e"
110+ end
111+ if (! startswith (val_str, " tri" )) # Means that not just triangles were requested
112+ t:: Char = val_str[1 ] # Accept "Top, Bot, Left" but default to Right
113+ anc = (t == ' t' ) ? " TC" : (t == ' b' ? " BC" : (t == ' l' ? " LM" : " RM" ))
114+ end
115+ return anc * tris
116+ end
117+
111118# Add to split code from above in these 2 function barriers to avoid all finish_PS_nested() invalidations
112119function add_opt_module_barr2 (symb:: Symbol ):: Union{String, Vector{String}}
113120 r:: Union{String, Vector{String}} = " "
0 commit comments