Scale.x_continuous
Map numerical data to x positions in cartesian coordinates.
Arguments
minvalue
: Set scale lower bound to be ≤ this value.maxvalue
: Set scale lower bound to be ≥ this value.
minvalue
and maxvalue
here are soft bounds, Gadfly may choose to ignore them when constructing an optimal plot. Use Coord.cartesian to enforce a hard bound.
labels
: Either aFunction
ornothing
. When a function is given, values are formatted using this function. The function should map a value inx
to a string giving its label. If the scale applies a transformation, transformed label values will be passed to this function.format
: How numbers should be formatted. One of:plain
,:scientific
,:engineering
, or:auto
. The default in:auto
which prints very large or very small numbers in scientific notation, and other numbers plainly.scalable
: When set to false, scale is fixed when zooming (default: true)
Variations
A number of transformed continuous scales are provided.
Scale.x_continuous
(scale without any transformation).Scale.x_log10
Scale.x_log2
Scale.x_log
Scale.x_asinh
Scale.x_sqrt
Aesthetics Acted On
x
, xmin
, xmax
, xintercept
Examples
# Transform both dimensions
plot(x=rand(10), y=rand(10), Scale.x_log)
# Force the viewport
plot(x=rand(10), y=rand(10), Scale.x_continuous(minvalue=-10, maxvalue=10))
# Use scientific notation
plot(x=rand(10), y=rand(10), Scale.x_continuous(format=:scientific))
# Use manual formatting
plot(x=rand(10), y=rand(10), Scale.x_continuous(labels=x -> @sprintf("%0.4f", x)))