Functions

Plotting functions

StatisticalGraphics.sggridFunction
sggrid(sgps...; opts...)

Position a collection of SG plots within a grid. The opts... refers to extra keyword arguments which can be passed to sggrid.

Keyword arguments

Plot appearance

  • align: Determine how to align plots. It can be one of :all, :each, or :none. default: :none

  • backcolor: The back color.

  • bordercolor: The color for the border of plots. default: :transparent

  • bounds: One of :full or :flush. See vega docs for more information. default: :full

  • center: The row and column centering, respectively. default: Bool[0, 0]

  • columns: Number of columns to be created.

  • columnspace: Space between columns. default: 0

  • rowspace: Space between rows. default: 0

source
StatisticalGraphics.sgplotFunction
sgplot(ds, plots;
                mapformats=true,
                nominal=nothing,
                xaxis=Axis(),
                x2axis=Axis(),
                yaxis=Axis(),
                y2axis=Axis(),
                legend=true,
                threads=automatic,
                opts...)

Produce a statistical graphics. The ds argument is referring to a data set (or grouped data set) and plots is a vector of marks, such as Bar, Pie,....

The opts... refers to extra keyword arguments which can be passed to sgplot. These keywords depend depend whether ds is a data set or a grouped data set. Below shows the available keyword arguments for each case.

Non-grouped data sets

Keyword arguments

Plot appearance

  • backcolor: The backgroud color for whole graph. default: :white

  • clip: The clip option for whole plot. default: true

  • font: The default font. default: "sans-serif"

  • fontweight: The font weight value. default: 400

  • groupcolormodel: The color model to be used when group is used for specific plot. default: :category

  • height: The width of plot. default: 400

  • italic: The default value whether the package use italic fonts. default: false

  • wallcolor: The backgroud color for plot area. default: :transparent

  • width: The width of plot. default: 600

Grouped data sets

source

Save figures

StatisticalGraphics.pdfFunction
pdf(filename::AbstractString, v::SGPlots; s=1)

Save the plot v as a pdf file with name filename. The s keyword can be used to scale the output.

source
StatisticalGraphics.pngFunction
png(filename::AbstractString, v::SGPlots; s=1)

Save the plot v as a png file with name filename. The s keyword can be used to scale the output.

source
StatisticalGraphics.savefigFunction
savefig(filename::AbstractString, v::SGPlots; s = 1)

Save the plot v as a file with name filename. The file format will be picked based on the extension of the filename.

source
StatisticalGraphics.svgFunction
svg(filename::AbstractString, v::SGPlots; s=1)

Save the plot v as a svg file with name filename. The s keyword can be used to scale the output.

source

Miscellaneous

StatisticalGraphics.gradientFunction
gradient([colors...]; direction = [0,1,0,0])

A linear gradient interpolates colors along a line, from a starting point to an ending point. By default a linear gradient runs horizontally, from left to right. Use the direction to configure the gradient direction, e.g. [0,0,0,1] runs the gradient vertically. All coordinates are defined in a normalized [0, 1] coordinate space, relative to the bounding box of the item being colored.

Examples

gradient()
gradient(:red, :white, :blue)
source