4646# #
4747
4848"""
49- scatter(XC::MeshArray ,YC::MeshArray ;color=:black,colorrange=[],colorbar=true,title="",kwargs...)
49+ scatter(XC::AbstractMeshArray ,YC::AbstractMeshArray ;color=:black,colorrange=[],colorbar=true,title="",kwargs...)
5050
5151```
5252scatter(Γ.XC,Γ.YC,color=:black)
5353MS=log10.(Γ.RAC)*μ
5454scatter(Γ.XC,Γ.YC,color=MS)
5555```
5656"""
57- function scatter(XC:: MeshArray ,YC:: MeshArray ;
57+ function scatter(XC:: AbstractMeshArray ,YC:: AbstractMeshArray ;
5858 color= :black,colorrange= [],colorbar= true ,title= " " ,kwargs... )
5959
6060 if isa(color,MeshArray)
@@ -68,22 +68,22 @@ function scatter(XC::MeshArray,YC::MeshArray;
6868
6969 fig = Figure(size = (900 ,600 ), backgroundcolor = :grey95)
7070 ax = Axis(fig[1 ,1 ],xlabel= " longitude" ,ylabel= " latitude" ,title= title)
71- scatter!(ax,XC:: MeshArray ,YC:: MeshArray ;
71+ scatter!(ax,XC:: AbstractMeshArray ,YC:: AbstractMeshArray ;
7272 color= color, colorrange= colorrange, colorbar= colorbar, kwargs... )
7373
7474 fig
7575end
7676
7777"""
78- scatter!(ax,XC::MeshArray ,YC::MeshArray ;color=:black,colorrange=[],colormap=:viridis)
78+ scatter!(ax,XC::AbstractMeshArray ,YC::AbstractMeshArray ;color=:black,colorrange=[],colormap=:viridis)
7979
8080```
8181fig=heatmap(Γ.Depth,interpolation=λ)
8282scatter!(current_axis(),Γ.XC,Γ.YC,color=:red)
8383fig
8484```
8585"""
86- function scatter!(ax,XC:: MeshArray ,YC:: MeshArray ;
86+ function scatter!(ax,XC:: AbstractMeshArray ,YC:: AbstractMeshArray ;
8787 color= :black,colorrange= [],colorbar= true ,colormap= :veridis,kwargs... )
8888
8989 if isa(color,MeshArray)&& isempty(colorrange)
@@ -111,7 +111,7 @@ function scatter!(ax,XC::MeshArray,YC::MeshArray;
111111end
112112
113113"""
114- heatmap(MS::MeshArray ; interpolation=nothing,globalmap=false,x=nothing,y=nothing,colorbar=true,title="",kwargs...)
114+ heatmap(MS::AbstractMeshArray ; interpolation=nothing,globalmap=false,x=nothing,y=nothing,colorbar=true,title="",kwargs...)
115115
116116Represent a `MeshArray` as a `heatmap`, or several, depending on keyword parameter choices.
117117
@@ -124,11 +124,11 @@ heatmap(MS,interpolation=λ,title="ocean depth") #same but w title
124124heatmap(MS,x=lon,y=lat) #only for simple domains; will show MS[1]
125125```
126126"""
127- heatmap(MS:: MeshArray ;interpolation= nothing ,globalmap= false ,x= nothing ,y= nothing ,colorbar= true ,title= " " ,kwargs... )= begin
127+ heatmap(MS:: AbstractMeshArray ;interpolation= nothing ,globalmap= false ,x= nothing ,y= nothing ,colorbar= true ,title= " " ,kwargs... )= begin
128128 if (! isnothing(interpolation))|| globalmap|| (! isnothing(x))
129129 f= Figure()
130130 ax= Axis(f[1 ,1 ],title= title)
131- hm1= heatmap!(ax,MS:: MeshArray ;
131+ hm1= heatmap!(ax,MS:: AbstractMeshArray ;
132132 interpolation= interpolation,globalmap= globalmap,x= x,y= y,
133133 kwargs... )
134134 colorbar ? Colorbar(f[1 ,2 ], hm1, height = Relative(0.65 )) : nothing
@@ -138,7 +138,7 @@ heatmap(MS::MeshArray;interpolation=nothing,globalmap=false,x=nothing,y=nothing,
138138 end
139139end
140140
141- function heatmap!(ax:: Axis ,MS:: MeshArray ;interpolation= nothing ,globalmap= false ,x= nothing ,y= nothing ,kwargs... )
141+ function heatmap!(ax:: Axis ,MS:: AbstractMeshArray ;interpolation= nothing ,globalmap= false ,x= nothing ,y= nothing ,kwargs... )
142142 if ! isnothing(interpolation)
143143 heatmap_interpolation!(ax,MS,interpolation;kwargs... )
144144 elseif globalmap
@@ -150,47 +150,47 @@ function heatmap!(ax::Axis,MS::MeshArray;interpolation=nothing,globalmap=false,x
150150 end
151151end
152152
153- function heatmap_globalmap!(ax,MS:: MeshArray ;kwargs... )
153+ function heatmap_globalmap!(ax,MS:: AbstractMeshArray ;kwargs... )
154154 γ= MS. grid
155155 DD= γ. write(MS)
156156# !isempty(colorrange) ? cr=colorrange : cr=(nanmin(DD),nanmax(DD))
157157 hm1= heatmap!(ax,DD;kwargs... )
158158end
159159
160- function heatmap_globalmap(MS:: MeshArray ;title= " " ,colorbar= true ,kwargs... )
160+ function heatmap_globalmap(MS:: AbstractMeshArray ;title= " " ,colorbar= true ,kwargs... )
161161 fig = Figure(size = (900 ,900 ), backgroundcolor = :grey95)
162162 ax = Axis(fig[1 ,1 ],xlabel= " i index" ,ylabel= " j index" ,title= title)
163163 hm1= heatmap_globalmap!(ax,MS;kwargs... )
164164 colorbar ? Colorbar(fig[1 ,2 ], hm1, height = Relative(0.65 )) : nothing
165165 fig
166166end
167167
168- heatmap_xy!(ax,MS:: MeshArray ,x:: Union{UnitRange,Array} ,y:: Union{UnitRange,Array} ;kwargs... ) = heatmap!(ax,x,y,MS[1 ];kwargs... )
169- # heatmap_xy!(ax,MS::MeshArray ,x::Union{UnitRange,Array},y::Union{UnitRange,Array};kwargs...) = surface!(ax,x,y,0*x;color=MS[1],shading=NoShading, kwargs...)
168+ heatmap_xy!(ax,MS:: AbstractMeshArray ,x:: Union{UnitRange,Array} ,y:: Union{UnitRange,Array} ;kwargs... ) = heatmap!(ax,x,y,MS[1 ];kwargs... )
169+ # heatmap_xy!(ax,MS::AbstractMeshArray ,x::Union{UnitRange,Array},y::Union{UnitRange,Array};kwargs...) = surface!(ax,x,y,0*x;color=MS[1],shading=NoShading, kwargs...)
170170
171- function heatmap_xy(MS:: MeshArray ,x:: Union{UnitRange,Array} ,y:: Union{UnitRange,Array} ;title= " " ,colorbar= true ,kwargs... )
171+ function heatmap_xy(MS:: AbstractMeshArray ,x:: Union{UnitRange,Array} ,y:: Union{UnitRange,Array} ;title= " " ,colorbar= true ,kwargs... )
172172 fig = Figure(size = (900 ,400 ), backgroundcolor = :grey95)
173173 ax = Axis(fig[1 ,1 ],xlabel= " longitude" ,ylabel= " latitude" ,title= title)
174174 hm1= heatmap_xy!(ax,MS,x,y;kwargs... )
175175 colorbar ? Colorbar(fig[1 ,2 ], hm1, height = Relative(0.65 )) : nothing
176176 fig
177177end
178178
179- function heatmap_interpolation!(ax,MS:: MeshArray ,λ:: NamedTuple ;kwargs... )
179+ function heatmap_interpolation!(ax,MS:: AbstractMeshArray ,λ:: NamedTuple ;kwargs... )
180180 DD= Interpolate(MS,λ. f,λ. i,λ. j,λ. w)
181181 DD= reshape(DD,size(λ. lon))
182182 hm1= heatmap!(ax,λ. lon[:,1 ],λ. lat[1 ,:],DD;kwargs... )
183183end
184184
185- function heatmap_interpolation(MS:: MeshArray ,λ:: NamedTuple ;title= " " ,colorbar= true ,kwargs... )
185+ function heatmap_interpolation(MS:: AbstractMeshArray ,λ:: NamedTuple ;title= " " ,colorbar= true ,kwargs... )
186186 fig = Figure(size = (900 ,400 ), backgroundcolor = :grey95)
187187 ax = Axis(fig[1 ,1 ],xlabel= " longitude" ,ylabel= " latitude" ,title= title)
188188 hm1= heatmap_interpolation!(ax,MS,λ;kwargs... )
189189 colorbar ? Colorbar(fig[1 ,2 ], hm1, height = Relative(0.65 )) : nothing
190190 fig
191191end
192192
193- function heatmap_tiled(MS:: MeshArray ;title= " " ,
193+ function heatmap_tiled(MS:: AbstractMeshArray ;title= " " ,
194194 colorbar= true ,colorrange= [],colormap= :viridis,kwargs... )
195195 fig = Figure(size = (900 ,900 ), backgroundcolor = :grey95)
196196 nf= length(MS. fSize)
@@ -717,7 +717,7 @@ function scatter!(pr_ax::PrAxis,lon,lat,kargs...; kwargs...)
717717 scatter!(pr_ax. ax,x,y,kargs... ; kwargs... )
718718end
719719
720- plot(x:: MeshArray ; kwargs... ) = begin
720+ plot(x:: AbstractMeshArray ; kwargs... ) = begin
721721 if ndims(x) == 1
722722 heatmap(x; kwargs... )
723723 else
0 commit comments