Visualization

Scientific visualization

The framework is integrated with the powerful Makie.jl ecosystem. The recipes documented below assume that a Makie backend is loaded in the same session.

Meshes.vizFunction
viz(object; [options])

Visualize Meshes.jl object with various options.

Available options

  • color - scalar or vector of colors for geometries
  • alpha - scalar or vector of transparency values in [0, 1]
  • colormap - color scheme (a.k.a. map) from ColorSchemes.jl
  • colorrange - minimum and maximum color values or symbol
  • showsegments - visualize segments
  • segmentcolor - color of segments
  • segmentsize - width of segments
  • showpoints - visualize points
  • pointmarker - marker of points
  • pointcolor - color of points
  • pointsize - size of points

For Mesh subtypes, the length of the vector of colors determines if the colors should be assigned to vertices or to elements.

Values passed to color can be of any type, as long as they can be converted to colors by the colorfy function from the Colorfy.jl package.

Examples

Different coloring methods (vertex vs. element):

# vertex coloring (i.e. linear interpolation)
viz(mesh, color = 1:nvertices(mesh))

# element coloring (i.e. discrete colors)
viz(mesh, color = 1:nelements(mesh))

Different strategies to show the boundary of geometries (showsegments vs. boundary):

# visualize boundary with showsegments
viz(polygon, showsegments = true)

# visualize boundary with separate call
viz(polygon)
viz!(boundary(polygon))

Notes

This function will only work in the presence of a Makie.jl backend via package extensions in Julia v1.9 or later versions of the language.

source

No docstring defined.

Plot type

The plot type alias for the viz function is Viz.

Attributes

alpha = 1.0No docs available.

color = :slategray3No docs available.

colormap = :viridisNo docs available.

colorrange = :extremaNo docs available.

pointcolor = :gray30No docs available.

pointmarker = :circleNo docs available.

pointsize = 4No docs available.

segmentcolor = :gray30No docs available.

segmentsize = 1.5No docs available.

showpoints = falseNo docs available.

showsegments = falseNo docs available.

source
Meshes.viz!Function
viz!(object; [options])

Visualize Meshes.jl object in an existing scene with options forwarded to viz.

source

viz! is the mutating variant of plotting function viz. Check the docstring for viz for further information.

source

Users can also call Makie's plot function in the geometry column as in

Mke.plot(data.geometry)

and this is equivalent to calling the viz recipe above. The plot function also works with other objects such as EmpiricalHistogram. That is convenient if you don't remember the name of the recipe.

Additionaly, we provide a basic scientific viewer to visualize all viewable variables in the data:

GeoTables.viewerFunction
viewer(geotable; kwargs...)

Basic scientific viewer for geospatial table geotable.

Aesthetic options are forwarded via kwargs to the Meshes.viz recipe.

Notes

This function will only work in the presence of a Makie.jl backend via package extensions in Julia v1.9 or later versions of the language.

source
GeoTables.cbarFunction
cbar(fig[row, col], values; colormap=:viridis, colorrange=:extrema)

Add a colorbar to fig[row, col] for the given values and options for the colorfy function from the Colorfy.jl package.

Notes

This function will only work in the presence of a Makie.jl backend via package extensions in Julia v1.9 or later versions of the language.

source

Statistical plots

Built-in

A hscatter plot between two variables var1 and var2 (possibly with var2 = var1) is a simple scatter plot in which the dots represent all ordered pairs of values of var1 and var2 at a given lag h.

data = georef((Z=[10sin(i/10) + j for i in 1:100, j in 1:200],))

samp = sample(data, UniformSampling(500))

fig = Mke.Figure(size = (800, 800))
hscatter(fig[1,1], samp, "Z", "Z", lag=0)
hscatter(fig[1,2], samp, "Z", "Z", lag=20)
hscatter(fig[2,1], samp, "Z", "Z", lag=40)
hscatter(fig[2,2], samp, "Z", "Z", lag=60)
fig
Example block output

Other plots

The plots below can be very useful to explore the distribution of values in a geotable.

PairPlots.jl provides the pairplot function to explore multivariate continuous distributions.

AlgebraOfGraphics.jl is a very flexible alternative that supports grouped and faceted layouts based on categorical variables.

Biplots.jl provides 2D and 3D statistical biplots for identifying main axes of variation.