Guides
Very similar to Geometries are guides, which draw graphics supporting the actual visualization, such as axis ticks, axis labels, and color keys. The major distinction is that geometries always draw within the rectangular plot frame, while guides have some special layout considerations.
Gadfly.Guide.annotation
Gadfly.Guide.colorkey
Gadfly.Guide.shapekey
Gadfly.Guide.sizekey
Gadfly.Guide.title
Gadfly.Guide.xlabel
Gadfly.Guide.xrug
Gadfly.Guide.xticks
Gadfly.Guide.ylabel
Gadfly.Guide.yrug
Gadfly.Guide.yticks
Gadfly.Guide.manual_color_key
Gadfly.Guide.manual_discrete_key
Gadfly.Guide.annotation
— TypeGuide.annotation(ctx::Compose.Context)
Overlay a plot with an arbitrary Compose
graphic. The context will inherit the plot's coordinate system, unless overridden with a custom unit box.
Gadfly.Guide.colorkey
— TypeGuide.colorkey[(; title=nothing, labels=nothing, pos=nothing)]
Guide.colorkey(title, labels, pos)
Enable control of the auto-generated colorkey. Set the colorkey title
for any plot, and the item labels
for plots with a discrete color scale. pos
overrides Theme(key_position=) and can be in either relative (e.g. [0.7w, 0.2h] is the lower right quadrant), absolute (e.g. [0mm, 0mm]), or plot scale (e.g. [0,0]) coordinates.
Gadfly.Guide.shapekey
— TypeGuide.shapekey[(; title="Shape", labels=String[], pos=Float64[])]
Guide.shapekey(title, labels, pos)
Enable control of the auto-generated shapekey. Set the key title
and the item labels
. pos
overrides Theme(key_position=) and can be in either relative (e.g. [0.7w, 0.2h] is the lower right quadrant), absolute (e.g. [0mm, 0mm]), or plot scale (e.g. [0,0]) coordinates. Guide.shapekey(nothing)
will hide the key.
Gadfly.Guide.sizekey
— TypeGuide.sizekey[(; title="size", labels=String[], pos=[])]
Guide.sizekey(title, labels, pos)
Enable control of the sizekey. Set the key title
and the item labels
. pos
overrides Theme(key_position=) and can be in either relative (e.g. [0.7w, 0.2h] is the lower right quadrant), absolute (e.g. [0mm, 0mm]), or plot scale (e.g. [0,0]) coordinates. Currently Guide.sizekey
will only work by adding Scale.size_discrete2
to the plot. Guide.sizekey(nothing)
will hide the key.
Gadfly.Guide.title
— TypeGuide.title(title)
Set the plot title.
Gadfly.Guide.xlabel
— TypeGuide.xlabel(label, orientation=:auto)
Sets the x-axis label for the plot. label
is either a String
or nothing
. orientation
can also be :horizontal
or :vertical
.
Gadfly.Guide.xrug
— TypeGuide.xrug
Draw a short vertical lines along the x-axis of a plot at the positions in the x
aesthetic.
Gadfly.Guide.xticks
— TypeGuide.xticks[(; label=true, ticks=:auto, orientation=:auto)]
Guide.xticks(label, ticks, orientation)
Formats the tick marks and labels for the x-axis. label
toggles the label visibility. ticks
can also be an array of locations, or nothing
. orientation
can also be :horizontal
or :vertical
.
Gadfly.Guide.ylabel
— TypeGuide.ylabel(label, orientation=:auto)
Sets the y-axis label for the plot. label
is either a String
or nothing
. orientation
can also be :horizontal
or :vertical
.
Gadfly.Guide.yrug
— TypeGuide.yrug
Draw short horizontal lines along the y-axis of a plot at the positions in the 'y' aesthetic.
Gadfly.Guide.yticks
— TypeGuide.yticks[(; label=true, ticks=:auto, orientation=:horizontal)]
Guide.yticks(ticks, label, orientation)
Formats the tick marks and labels for the y-axis. label
toggles the label visibility. ticks
can also be an array of locations, or nothing
. orientation
can also be :auto
or :vertical
.
Gadfly.Guide.manual_color_key
— FunctionGuide.manual_color_key(title::String, labels::Vector{String}, color::AbstractVector=
1:length(labels); pos=[], shape=Function[], size=Measure[])
Similar to Guide.manual_discrete_key
. color
can be Ints, or Colors and/or Strings (default is Ints).
Gadfly.Guide.manual_discrete_key
— MethodGuide.manual_discrete_key(title::String, labels::Vector{String};
pos=[], color=Colorant[], shape=Function[], size=Measure[])
Manually define a discrete key with the legend title
and labels
, and swatch color
, shape
and size
. The swatch aesthetics can be Vectors of specific types (as above), or integer ranges. Integer ranges refer to the order of items in the discrete Theme palettes Discrete Scales. Set the key position inside using pos
(see Guide.sizekey
, Guide.shapekey
).