Plot Packages

Example to define the plot package to be used:

using SignalTables
usePlotPackage("PyPlot")    # or ENV["SignalTablesPlotPackage"] = "PyPlot"

The following plot packages are supported:

Typically, runtests.jl is defined as:

using SignalTables
usePlotPackage("SilentNoPlot") # Define Plot Package (previously defined one is put on a stack)
include("include_all.jl")      # Include all tests that use a plot package
usePreviousPlotPackage()       # Use previously defined Plot package

The following functions are provided to define/inquire the current plot package.

Note

SignalTables.jl exports all symbols of this table.
Modia.jl reexports all symbols.

Plot package functionsDescription
@usingPlotPackageExpands into using PlotPackage_<PlotPackageName>
usePlotPackageDefine the plot package to be used.
usePreviousPlotPackageDefine the previously defined plot package to be used.
currentPlotPackageReturn name defined with usePlotPackage
SignalTables.usePlotPackageFunction
usePlotPackage(plotPackage::String)

Define the plot package that shall be used by command @usingPlotPackage. If a PlotPackage package is already defined, save it on an internal stack (can be reactivated with usePreviousPlotPackage().

Possible values for plotPackage:

  • "PyPlot"
  • "GLMakie"
  • "WGLMakie"
  • "CairoMakie"
  • "SilentNoPlot"

Example

using SignalTables
usePlotPackage("GLMakie")

module MyTest
    using SignalTables
    @usingPlotPackage

    t = range(0.0, stop=10.0, length=100)
    result = Dict{String,Any}("time" => t, "phi" => sin.(t))

    plot(result, "phi")  # use GLMakie for the rendering
end
source
SignalTables.currentPlotPackageFunction
currentPlotPackage()

Return the name of the plot package as a string that was defined with usePlotPackage. For example, the function may return "GLMakie", "PyPlot" or "NoPlot" or or "", if no PlotPackage is defined.

source