Scales
Scales, similarly to Statistics, apply a transformation to the original data, typically mapping one aesthetic to the same aesthetic, while retaining the original value. For example, the Scale.x_log10 aesthetic maps the x
aesthetic back to the x
aesthetic after applying a log10 transformation, but keeps track of the original value so that data points are properly identified.
Gadfly.Scale.color_identity
Gadfly.Scale.color_none
Gadfly.Scale.label
Gadfly.Scale.color_asinh
Gadfly.Scale.color_continuous
Gadfly.Scale.color_discrete_hue
Gadfly.Scale.color_discrete_manual
Gadfly.Scale.color_log
Gadfly.Scale.color_log10
Gadfly.Scale.color_log2
Gadfly.Scale.color_sqrt
Gadfly.Scale.group_discrete
Gadfly.Scale.lab_gradient
Gadfly.Scale.lab_rainbow
Gadfly.Scale.lchabmix
Gadfly.Scale.linestyle_discrete
Gadfly.Scale.luv_rainbow
Gadfly.Scale.shape_discrete
Gadfly.Scale.shape_identity
Gadfly.Scale.size_continuous
Gadfly.Scale.size_discrete
Gadfly.Scale.size_identity
Gadfly.Scale.weighted_color_mean
Gadfly.Scale.x_asinh
Gadfly.Scale.x_continuous
Gadfly.Scale.x_discrete
Gadfly.Scale.x_distribution
Gadfly.Scale.x_log
Gadfly.Scale.x_log10
Gadfly.Scale.x_log2
Gadfly.Scale.x_sqrt
Gadfly.Scale.xgroup
Gadfly.Scale.y_asinh
Gadfly.Scale.y_continuous
Gadfly.Scale.y_discrete
Gadfly.Scale.y_distribution
Gadfly.Scale.y_func
Gadfly.Scale.y_log
Gadfly.Scale.y_log10
Gadfly.Scale.y_log2
Gadfly.Scale.y_sqrt
Gadfly.Scale.ygroup
Gadfly.Scale.z_func
Gadfly.Scale.color_identity
— Type.color_identity
Gadfly.Scale.color_none
— Type.color_none
Suppress the default color scale that some statistics impose by setting the color
aesthetic to nothing
.
Gadfly.Scale.label
— Type.label
Gadfly.Scale.color_asinh
— Function.color_asinh[(; minvalue=nothing, maxvalue=nothing, colormap)]
Similar to Scale.color_continuous
, except that color
is asinh transformed.
Gadfly.Scale.color_continuous
— Function.color_continuous[(; minvalue=nothing, maxvalue=nothing, colormap)]
Create a continuous color scale by mapping the color
aesthetic to a Color
. minvalue
and maxvalue
specify the data values corresponding to the bottom and top of the color scale. colormap
is a function defined on the interval from 0 to 1 that returns a Color
.
Either input Stat.color_continuous
as an argument to plot
, or set continuous_color_scale
in a Theme.
See also color_log10
, color_log2
, color_log
, color_asinh
, and color_sqrt
.
Gadfly.Scale.color_discrete_hue
— Function.color_discrete_hue[(f; levels=nothing, order=nothing, preserve_order=true)]
Create a discrete color scale that maps the categorical levels in the color
aesthetic to Color
s. f
is a function that produces a vector of colors. levels
gives values for the scale. Order will be respected and anything in the data that's not represented in levels
will be set to missing. order
is a vector of integers giving a permutation of the levels default order. If preserve_order
is true
orders levels as they appear in the data.
Either input Stat.color_discrete_hue
as an argument to plot
, or set discrete_color_scale
in a Theme.
Examples
julia> x = Scale.color_discrete_hue()
Gadfly.Scale.DiscreteColorScale(Gadfly.Scale.default_discrete_colors, nothing, nothing, true)
julia> x.f(3)
3-element Array{ColorTypes.Color,1}:
LCHab{Float32}(70.0,60.0,240.0)
LCHab{Float32}(80.0,70.0,100.435)
LCHab{Float32}(65.8994,62.2146,353.998)
Gadfly.Scale.color_discrete_manual
— Method.color_discrete_manual(colors...; levels=nothing, order=nothing)
Similar to color_discrete_hue
except that colors for each level are specified directly instead of being computed by a function.
Gadfly.Scale.color_log
— Function.color_log[(; minvalue=nothing, maxvalue=nothing, colormap)]
Similar to Scale.color_continuous
, except that color
is log transformed.
Gadfly.Scale.color_log10
— Function.color_log10[(; minvalue=nothing, maxvalue=nothing, colormap)]
Similar to Scale.color_continuous
, except that color
is log10 transformed.
Gadfly.Scale.color_log2
— Function.color_log2[(; minvalue=nothing, maxvalue=nothing, colormap)]
Similar to Scale.color_continuous
, except that color
is log2 transformed.
Gadfly.Scale.color_sqrt
— Function.color_sqrt[(; minvalue=nothing, maxvalue=nothing, colormap)]
Similar to Scale.color_continuous
, except that color
is sqrt transformed.
Gadfly.Scale.group_discrete
— Method.group_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Similar to Scale.x_discrete
, except applied to the group
aesthetic.
Gadfly.Scale.lab_gradient
— Method.function lab_gradient(cs::Color...)
Gadfly.Scale.lab_rainbow
— Method.lab_rainbow(l, c, h0, n)
Generate n
colors in the LCHab colorspace by using a fixed luminance l
and chroma c
, and varying the hue, starting at h0
.
Gadfly.Scale.lchabmix
— Method.function lchabmix(c0_, c1_, r, power)
Gadfly.Scale.linestyle_discrete
— Method.linestyle_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Similar to Scale.x_discrete
, except applied to the linestyle
aesthetic.
Gadfly.Scale.luv_rainbow
— Method.luv_rainbow(l, c, h0, n)
Generate n
colors in the LCHuv colorspace by using a fixed luminance l
and chroma c
, and varying the hue, starting at h0
.
Gadfly.Scale.shape_discrete
— Method.shape_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Similar to Scale.x_discrete
, except applied to the shape
aesthetic.
Gadfly.Scale.shape_identity
— Method.shape_identity()
Gadfly.Scale.size_continuous
— Function.size_continuous[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Gadfly.Scale.size_discrete
— Method.size_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Similar to Scale.x_discrete
, except applied to the size
aesthetic.
Gadfly.Scale.size_identity
— Method.size_identity()
Gadfly.Scale.weighted_color_mean
— Method.function weighted_color_mean(cs::AbstractArray{Lab{T},1},
ws::AbstractArray{S,1}) where {S <: Number,T}
Return the mean of Lab colors cs
as weighted by ws
.
Gadfly.Scale.x_asinh
— Function.x_asinh[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.x_continuous
, except that the aesthetics are asinh
transformed and the labels
function inputs transformed values.
Gadfly.Scale.x_continuous
— Function.x_continuous[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Map the x
, xmin
, xmax
, xintercept
, intercept
, xviewmin
, xviewmax
and xend
aesthetics to x positions in Cartesian coordinates, which are presumed to be numerical, using an identity transform. minvalue
and maxvalue
set soft lower and upper bounds. (Use Coord.cartesian
to enforce a hard bound.) labels
is a function which maps a coordinate value to a string label. format
is one of :plain
, :scientific
, :engineering
, or :auto
. Set scalable
to false to prevent zooming on this axis. See also x_log10
, x_log2
, x_log
, x_asinh
, and x_sqrt
for alternatives to the identity transform.
Gadfly.Scale.x_discrete
— Method.x_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Map the x
, xmin
, xmax
, xintercept
, intercept
, xviewmin
, xviewmax
and xend
aesthetics, which are presumed to be categorical, to Cartesian coordinates. Unlike Scale.x_continuous
, each unique x value will be mapped to equally spaced positions, regardless of value.
By default continuous scales are applied to numerical data. If data consists of numbers specifying categories, explicitly adding Scale.x_discrete
is the easiest way to get that data to plot appropriately.
labels
is either a function which maps a coordinate value to a string label, or a vector of strings of the same length as the number of unique values in the aesthetic. levels
gives values for the scale. Order will be respected and anything in the data that's not respresented in levels
will be set to missing
. order
is a vector of integers giving a permutation of the levels default order.
See also group_discrete
, shape_discrete
, size_discrete
, and linestyle_discrete
.
Gadfly.Scale.x_distribution
— Method.x_distribution()
Gadfly.Scale.x_log
— Function.x_log[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.x_continuous
, except that the aesthetics are log
transformed and the labels
function inputs transformed values.
Gadfly.Scale.x_log10
— Function.x_log10[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.x_continuous
, except that the aesthetics are log10
transformed and the labels
function inputs transformed values.
Gadfly.Scale.x_log2
— Function.x_log2[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.x_continuous
, except that the aesthetics are log2
transformed and the labels
function inputs transformed values.
Gadfly.Scale.x_sqrt
— Function.x_sqrt[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.x_continuous
, except that the aesthetics are sqrt
transformed and the labels
function inputs transformed values.
Gadfly.Scale.xgroup
— Method.xgroup[(; labels=nothing, levels=nothing, order=nothing)]
Gadfly.Scale.y_asinh
— Function.y_asinh[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.y_continuous
, except that the aesthetics are asinh
transformed and the labels
function inputs transformed values.
Gadfly.Scale.y_continuous
— Function.y_continuous[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Map the y
, ymin
, ymax
, yintercept
, slope
, middle
, upper_fence
, lower_fence
, upper_hinge
, lower_hinge
, yviewmin
, yviewmax
and yend
aesthetics to y positions in Cartesian coordinates, which are presumed to be numerical, using an identity transform. minvalue
and maxvalue
set soft lower and upper bounds. (Use Coord.cartesian
to enforce a hard bound.) labels
is a function which maps a coordinate value to a string label. format
is one of :plain
, :scientific
, :engineering
, or :auto
. Set scalable
to false to prevent zooming on this axis. See also y_log10
, y_log2
, y_log
, y_asinh
, and y_sqrt
for alternatives to the identity transform.
Gadfly.Scale.y_discrete
— Method.y_discrete[(; labels=nothing, levels=nothing, order=nothing)]
Map the y
, ymin
, ymax
, yintercept
, slope
, middle
, upper_fence
, lower_fence
, upper_hinge
, lower_hinge
, yviewmin
, yviewmax
and yend
aesthetics, which are presumed to be categorical, to Cartesian coordinates. Unlike Scale.x_continuous
, each unique y value will be mapped to equally spaced positions, regardless of value.
By default continuous scales are applied to numerical data. If data consists of numbers specifying categories, explicitly adding Scale.y_discrete
is the easiest way to get that data to plot appropriately.
labels
is either a function which maps a coordinate value to a string label, or a vector of strings of the same length as the number of unique values in the aesthetic. levels
gives values for the scale. Order will be respected and anything in the data that's not respresented in levels
will be set to missing
. order
is a vector of integers giving a permutation of the levels default order.
See also group_discrete
, shape_discrete
, size_discrete
, and linestyle_discrete
.
Gadfly.Scale.y_distribution
— Method.y_distribution()
Gadfly.Scale.y_func
— Method.y_func()
Gadfly.Scale.y_log
— Function.y_log[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.y_continuous
, except that the aesthetics are log
transformed and the labels
function inputs transformed values.
Gadfly.Scale.y_log10
— Function.y_log10[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.y_continuous
, except that the aesthetics are log10
transformed and the labels
function inputs transformed values.
Gadfly.Scale.y_log2
— Function.y_log2[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.y_continuous
, except that the aesthetics are log2
transformed and the labels
function inputs transformed values.
Gadfly.Scale.y_sqrt
— Function.y_sqrt[(; minvalue=nothing, maxvalue=nothing, labels=nothing,
format=nothing, minticks=2, maxticks=10, scalable=true)]
Similar to Scale.y_continuous
, except that the aesthetics are sqrt
transformed and the labels
function inputs transformed values.
Gadfly.Scale.ygroup
— Method.ygroup[(; labels=nothing, levels=nothing, order=nothing)]
Gadfly.Scale.z_func
— Method.z_func()