diff --git a/README.md b/README.md
index b6a4de05a..c241e0e0e 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ If you use **Gadfly** in a publication please consider citing it: [![DOI][citati
- Interactivity like panning, zooming, toggling powered by [Snap.svg](http://snapsvg.io/)
- Supports a large number of common plot types
-## Installation
+## Installation & Quickstart
**Gadfly** is registered on `METADATA.jl` and so can be installed using `Pkg.add`.
@@ -31,6 +31,19 @@ If you use **Gadfly** in a publication please consider citing it: [![DOI][citati
Pkg.add("Gadfly")
```
+To create a plot it's as simple as:
+
+```julia
+using Gadfly
+plot(y=[1,2,3])
+```
+
+## Gallery
+
+
+
## Documentation
- [**STABLE**][docs-stable-url] — **most recently tagged version of the documentation.**
diff --git a/docs/make.jl b/docs/make.jl
index 4acf48483..0b18e29c9 100644
--- a/docs/make.jl
+++ b/docs/make.jl
@@ -16,12 +16,20 @@ makedocs(
"Backends" => "man/backends.md",
"Themes" => "man/themes.md",
],
+ "Gallery" => Any[
+ "Geometries" => "gallery/geometries.md",
+ "Guides" => "gallery/guides.md",
+ #"Statistics" => "gallery/stats.md",
+ #"Coords" => "gallery/coords.md",
+ #"Scales" => "gallery/scales.md",
+ #"Shapes" => "gallery/shapes.md",
+ ],
"Library" => Any[
- hide("Geometries" => "lib/geometries.md", load_dir("geoms")),
- hide("Guides" => "lib/guides.md", load_dir("guides")),
- hide("Statistics" => "lib/stats.md", load_dir("stats")),
- hide("Coords" => "lib/coords.md", load_dir("coords")),
- hide("Scales" => "lib/scales.md", load_dir("scales")),
+ "Geometries" => "lib/geometries.md",
+ "Guides" => "lib/guides.md",
+ "Statistics" => "lib/stats.md",
+ "Coords" => "lib/coords.md",
+ "Scales" => "lib/scales.md",
"Shapes" => "lib/shapes.md",
],
"Development" => Any[
diff --git a/docs/src/assets/gallery.png b/docs/src/assets/gallery.png
new file mode 100644
index 000000000..05443d52c
Binary files /dev/null and b/docs/src/assets/gallery.png differ
diff --git a/docs/src/gallery/geometries.md b/docs/src/gallery/geometries.md
new file mode 100644
index 000000000..61bbfc54d
--- /dev/null
+++ b/docs/src/gallery/geometries.md
@@ -0,0 +1,94 @@
+# Geometries
+
+## Geom.point
+
+```@setup 1
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth", Geom.point)
+```
+
+```@example
+# Binding categorial data to the color aesthetic
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
+ color="Species", Geom.point)
+```
+
+```@example
+# Binding continuous data to the color aesthetic
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
+ color="PetalLength", Geom.point)
+```
+
+```@example
+# Binding categorial data to x
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("lattice", "singer"), x="VoicePart", y="Height", Geom.point)
+```
+
+```@example
+# Binding categorical data to the shape aesthetic
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
+ shape="Species", color="Species", Geom.point)
+```
+
+```@example
+# Different colored layers
+using Gadfly, Distributions
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+rdata = rand(MvNormal([0,0.],[1 0;0 1.]),100)
+bdata = rand(MvNormal([1,0.],[1 0;0 1.]),100)
+plot(layer(x=rdata[1,:], y=rdata[2,:], color=[colorant"red"], Geom.point),
+ layer(x=bdata[1,:], y=bdata[2,:], color=[colorant"blue"], Geom.point))
+```
+
+## Geom.bar
+
+```@example
+using Gadfly, RDatasets
+set_default_plot_size(12cm, 8cm) # hide
+plot(dataset("HistData", "ChestSizes"), x="Chest", y="Count", Geom.bar)
+```
+
+```@example
+using Gadfly, RDatasets
+set_default_plot_size(12cm, 8cm) # hide
+plot(by(dataset("datasets","HairEyeColor"),[:Eye,:Sex], d->sum(d[:Freq])),
+ color="Eye", y="x1", x="Sex",
+ Geom.bar(position=:dodge), Guide.ylabel("Freq"))
+```
+
+```@example
+using Gadfly, RDatasets, DataFrames
+set_default_plot_size(14cm, 8cm) # hide
+D = by(dataset("datasets","HairEyeColor"), [:Eye,:Sex], d->sum(d[:Freq]))
+ rename!(D, :x1, :Frequency)
+palette = ["blue","brown","green","tan"] # Is there a hazel color?
+
+pa= plot(D, x=:Sex, y=:Frequency, color=:Eye, Geom.bar(position=:stack),
+ Scale.color_discrete_manual(palette...))
+pb= plot(D, x=:Sex, y=:Frequency, color=:Eye, Geom.bar(position=:stack),
+ Scale.color_discrete_manual(palette[4:-1:1]..., order=[4,3,2,1]))
+hstack(pa, pb)
+```
+
+## Geom.line
+
+```@example 1
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("lattice", "melanoma"), x="Year", y="Incidence", Geom.line)
+```
+
+```@example 1
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("Zelig", "approval"), x="Month", y="Approve", color="Year", Geom.line)
+```
diff --git a/docs/src/gallery/guides.md b/docs/src/gallery/guides.md
new file mode 100644
index 000000000..802249007
--- /dev/null
+++ b/docs/src/gallery/guides.md
@@ -0,0 +1,50 @@
+# Guides
+
+## Guide.title
+
+```@example
+using Gadfly, RDatasets
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(dataset("ggplot2", "diamonds"), x="Price", Geom.histogram,
+ Guide.title("Diamond Price Distribution"))
+```
+
+## Guide.xlabel
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.xlabel("Angle"))
+```
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.xlabel("Angle", orientation=:vertical))
+```
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.xlabel(nothing))
+```
+
+## Guide.ylabel
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.ylabel("cos(x)"))
+```
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.ylabel("cos(x)", orientation=:horizontal))
+```
+
+```@example
+using Gadfly
+Gadfly.set_default_plot_size(14cm, 8cm) # hide
+plot(cos, 0, 2π, Guide.ylabel(nothing))
+```
diff --git a/docs/src/lib/geometries.md b/docs/src/lib/geometries.md
index 22494b745..0aec6fa09 100644
--- a/docs/src/lib/geometries.md
+++ b/docs/src/lib/geometries.md
@@ -10,9 +10,8 @@ draw things. For instance, the [Geom.point](@ref) geometry draws points using
the `x` and `y` aesthetics, while the [Geom.line](@ref) geometry draws lines
with those same two aesthetics.
-## Available Geometries
-
-```@contents
-Pages = map(file -> joinpath("geoms", file), readdir("geoms"))
-Depth = 1
+```@docs
+Geom.point
+Geom.bar
+Geom.line
```
diff --git a/docs/src/lib/geoms/geom_bar.md b/docs/src/lib/geoms/geom_bar.md
index 90b0ce71a..ebffefea1 100644
--- a/docs/src/lib/geoms/geom_bar.md
+++ b/docs/src/lib/geoms/geom_bar.md
@@ -4,74 +4,8 @@ Author = "Daniel C. Jones"
# Geom.bar
-Draw bar plots. This geometry works on pre-summarized data such as counts. To
-draw histograms from a series of observations, add [Stat.histogram](@ref) to the plot,
-or use the convenient geometry [Geom.histogram](@ref).
-
-## Aesthetics
-
- * `y`: Height of each bar.
- * `color` (optional): Group categorically by color.
-
-Either
-
- * `x`: Position of each bar.
-
-Or
-
- * `xmin`: Starting x positions for each bar.
- * `xmax`: End x positions for each bar.
-
-If `x` is given, a bar will be drawn at each x value, specifying both `xmin` and
-`xmax` allows bars of variable width to be drawn.
-
-## Arguments
-
- * `position`: Either `:stack` or `:dodge`. If the `color` aesthetic is
- bound this determines how bars of different colors should be arranged:
- stacked on top of each other, or placed side by side.
-
- * `orientation`: Either `:vertical` (default) or `:horizontal`. If
- `:horizontal`, then the required aesthetics are `y` or `ymin/ymax`.
-
## Examples
-```@setup 1
-using RDatasets
-using Gadfly
-set_default_plot_size(12cm, 8cm)
-```
-
-```@example 1
-plot(dataset("HistData", "ChestSizes"), x="Chest", y="Count", Geom.bar)
-```
-
-```@example 1
-plot(by(dataset("datasets","HairEyeColor"),[:Eye,:Sex], d->sum(d[:Freq])),
- color="Eye", y="x1", x="Sex",
- Geom.bar(position=:dodge), Guide.ylabel("Freq"))
-```
-
-```@setup 2
-using RDatasets
-using DataFrames, Gadfly
-set_default_plot_size(14cm, 8cm)
-```
-
-```@example 2
-D = by(dataset("datasets","HairEyeColor"), [:Eye,:Sex], d->sum(d[:Freq]))
- rename!(D, :x1, :Frequency)
-# Is there a hazel color?
-palette = ["blue","brown","green","tan"]
-
-pa= plot(D, x=:Sex, y=:Frequency, color=:Eye, Geom.bar(position=:stack),
- Scale.color_discrete_manual(palette...)
-)
-pb= plot(D, x=:Sex, y=:Frequency, color=:Eye, Geom.bar(position=:stack),
- Scale.color_discrete_manual(palette[4:-1:1]..., order=[4,3,2,1])
-)
-hstack(pa, pb)
-```
See [Scale.color_discrete_manual](@ref) for more information.
diff --git a/docs/src/lib/geoms/geom_line.md b/docs/src/lib/geoms/geom_line.md
index 9b710cb86..6028977de 100644
--- a/docs/src/lib/geoms/geom_line.md
+++ b/docs/src/lib/geoms/geom_line.md
@@ -4,33 +4,7 @@ Author = "Daniel C. Jones"
# Geom.line
-## Aesthetics
-
- * `x`: X-axis position.
- * `y`: Y-axis position.
- * `group` (optional): Group categorically.
- * `color` (optional): Group categorically and indicate by color.
-
-## Arguments
-
- * `preserve_order`: Default behavior for `Geom.line` is to draw lines between
- points in order along the x-axis. If this option is true, lines will be
- drawn between points in the order they appear in the data. `Geom.path()` is
- `Geom.line(preserve_order=true)`.
## Examples
-```@setup 1
-using RDatasets
-using Gadfly
-Gadfly.set_default_plot_size(14cm, 8cm)
-```
-
-```@example 1
-plot(dataset("lattice", "melanoma"), x="Year", y="Incidence", Geom.line)
-```
-
-```@example 1
-plot(dataset("Zelig", "approval"), x="Month", y="Approve", color="Year", Geom.line)
-```
diff --git a/docs/src/lib/geoms/geom_point.md b/docs/src/lib/geoms/geom_point.md
index a6406b6c6..ba146c60a 100644
--- a/docs/src/lib/geoms/geom_point.md
+++ b/docs/src/lib/geoms/geom_point.md
@@ -4,56 +4,5 @@ Author = "Daniel C. Jones"
# Geom.point
-The point geometry is used to draw various types of scatterplots.
-
-## Aesthetics
-
- * `x`: X-axis position.
- * `y`: Y-axis position.
- * `color` (optional): Point color. Categorical data will choose maximally distinguishable colors from the LCHab color space. Continuous data will map onto LCHab as well. Colors can also be specified explicitly for each data point with a vector of colors of length(x). A vector of length one specifies the color to use for all points. Default is Theme.default_color.
- * `shape` (optional): Point shape. Categorical data will cycle through Theme.point_shapes. Shapes can also be specified explicitly for each data point with a vector of shapes of length(x). A vector of length one specifies the shape to use for all points. Default is Theme.point_shapes[1].
- * `size` (optional): Point size. Categorical data and vectors of Ints will interpolate between Theme.point_size_{min,max}. A continuous vector of AbstractFloats or Measures of length(x) specifies the size of each data point explicitly. A vector of length one specifies the size to use for all points. Default is Theme.point_size.
-
## Examples
-```@setup 1
-using RDatasets
-using Gadfly
-Gadfly.set_default_plot_size(14cm, 8cm)
-```
-
-```@example 1
-plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth", Geom.point)
-```
-
-```@example 1
-# Binding categorial data to the color aesthetic
-plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
- color="Species", Geom.point)
-```
-
-```@example 1
-# Binding continuous data to the color aesthetic
-plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
- color="PetalLength", Geom.point)
-```
-
-```@example 1
-# Binding categorial data to x
-plot(dataset("lattice", "singer"), x="VoicePart", y="Height", Geom.point)
-```
-
-```@example 1
-# Binding categorical data to the shape aesthetic
-plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
- shape="Species", color="Species", Geom.point)
-```
-
-```@example 1
-# Different colored layers
-using Distributions
-rdata = rand(MvNormal([0,0.],[1 0;0 1.]),100)
-bdata = rand(MvNormal([1,0.],[1 0;0 1.]),100)
-plot(layer(x=rdata[1,:], y=rdata[2,:], color=[colorant"red"], Geom.point),
- layer(x=bdata[1,:], y=bdata[2,:], color=[colorant"blue"], Geom.point))
-```
diff --git a/docs/src/lib/guides.md b/docs/src/lib/guides.md
index 3b5c77526..deb2300c2 100644
--- a/docs/src/lib/guides.md
+++ b/docs/src/lib/guides.md
@@ -2,7 +2,6 @@
Author = "Daniel C. Jones"
```
-
# Guides
Very similar to [Geometries](@ref) are guides, which draw graphics supporting the
@@ -10,9 +9,8 @@ actual visualization, such as axis ticks and labels and color keys. The major
distinction is that geometries always draw within the rectangular plot frame,
while guides have some special layout considerations.
-## Available Guides
-
-```@contents
-Pages = map(file -> joinpath("guides", file), readdir("guides"))
-Depth = 1
+```@docs
+Guide.title
+Guide.xlabel
+Guide.ylabel
```
diff --git a/docs/src/lib/guides/guide_title.md b/docs/src/lib/guides/guide_title.md
index 267223c40..97abb04ec 100644
--- a/docs/src/lib/guides/guide_title.md
+++ b/docs/src/lib/guides/guide_title.md
@@ -4,11 +4,6 @@ Author = "Darwin Darakananda"
# Guide.title
-Set the plot tile
-
-## Arguments
- * `title`: Plot title
-
## Examples
```@setup 1
diff --git a/docs/src/lib/guides/guide_xlabel.md b/docs/src/lib/guides/guide_xlabel.md
index a3f9852f9..09a0510b9 100644
--- a/docs/src/lib/guides/guide_xlabel.md
+++ b/docs/src/lib/guides/guide_xlabel.md
@@ -4,31 +4,5 @@ Author = "Darwin Darakananda"
# Guide.xlabel
-Sets the x-axis label for the plot.
-
-## Arguments
- * `label`: X-axis label
- * `orientation` (optional): `:horizontal`, `:vertical`, or `:auto` (default)
-
-`label` is not a keyword parameter, it must be supplied as the first
-argument of [Guide.xlabel](@ref). Setting it to `nothing` will suppress
-the default label.
-
## Examples
-```@setup 1
-using Gadfly
-Gadfly.set_default_plot_size(14cm, 8cm)
-```
-
-```@example 1
-plot(cos, 0, 2π, Guide.xlabel("Angle"))
-```
-
-```@example 1
-plot(cos, 0, 2π, Guide.xlabel("Angle", orientation=:vertical))
-```
-
-```@example 1
-plot(cos, 0, 2π, Guide.xlabel(nothing))
-```
diff --git a/docs/src/lib/guides/guide_ylabel.md b/docs/src/lib/guides/guide_ylabel.md
index 28f888b40..fd9c8ed55 100644
--- a/docs/src/lib/guides/guide_ylabel.md
+++ b/docs/src/lib/guides/guide_ylabel.md
@@ -4,32 +4,5 @@ Author = "Darwin Darakananda"
# Guide.ylabel
-Sets the y-axis label for the plot.
-
-## Arguments
- * `label`: Y-axis label
- * `orientation` (optional): `:horizontal`, `:vertical`, or `:auto` (default)
-
-`label` is not a keyword parameter, it must be supplied as the first
-argument of `Guide.ylabel`. Setting it to `nothing` will suppress
-the default label.
-
## Examples
-```@setup 1
-using Gadfly
-Gadfly.set_default_plot_size(14cm, 8cm)
-```
-
-
-```@example 1
-plot(cos, 0, 2π, Guide.ylabel("cos(x)"))
-```
-
-```@example 1
-plot(cos, 0, 2π, Guide.ylabel("cos(x)", orientation=:horizontal))
-```
-
-```@example 1
-plot(cos, 0, 2π, Guide.ylabel(nothing))
-```
diff --git a/src/geom/bar.jl b/src/geom/bar.jl
index eee03697f..86f68c51d 100644
--- a/src/geom/bar.jl
+++ b/src/geom/bar.jl
@@ -9,6 +9,35 @@ BarGeometry(; position=:stack, orientation=:vertical, tag=empty_tag) =
BarGeometry(position, orientation, Gadfly.Stat.bar(position=position,
orientation = orientation), tag)
+"""
+Draw bar plots. This geometry works on pre-summarized data such as counts. To
+draw histograms from a series of observations, add [`Stat.histogram`](@ref) to the plot,
+or use the convenient geometry [`Geom.histogram`](@ref).
+
+# Aesthetics
+- `y`: Height of each bar.
+- `color` (optional): Group categorically by color.
+
+Either
+
+- `x`: Position of each bar.
+
+Or
+
+- `xmin`: Starting x positions for each bar.
+- `xmax`: End x positions for each bar.
+
+If `x` is given, a bar will be drawn at each x value, specifying both `xmin` and
+`xmax` allows bars of variable width to be drawn.
+
+# Arguments
+- `position`: Either `:stack` or `:dodge`. If the `color` aesthetic is
+ bound this determines how bars of different colors should be arranged:
+ stacked on top of each other, or placed side by side.
+
+- `orientation`: Either `:vertical` (default) or `:horizontal`. If
+ `:horizontal`, then the required aesthetics are `y` or `ymin/ymax`.
+"""
const bar = BarGeometry
histogram(; position=:stack, bincount=nothing,
diff --git a/src/geom/label.jl b/src/geom/label.jl
index 65fadbb72..b48ca91f9 100644
--- a/src/geom/label.jl
+++ b/src/geom/label.jl
@@ -1,3 +1,6 @@
+### only single scale in SVG[^JS]
+### move parameters to theme
+
struct LabelGeometry <: Gadfly.GeometryElement
# One of :dynamic, :left, :right, :above, :below, :centered
position::Symbol
@@ -70,6 +73,7 @@ function deferred_label_context(geom::LabelGeometry,
push!(positions, Absolute2DBox((x, y), (text_width, text_height)))
end
+ ### locations of the points that are labelled
# TODO: use Aesthetics.size and/or theme.point_size
for (x, y) in point_positions
push!(positions, Absolute2DBox((x - 0.5mm, y - 0.5mm), (1.0mm, 1.0mm)))
@@ -100,7 +104,7 @@ function deferred_label_context(geom::LabelGeometry,
# the start labels that overlap points. We should be able to precompute
# that, since they're static.
- for j in 1:n
+ for j in 1:n ### n-1 ?
for i in (j+1):n
if overlaps(max_extents(i), max_extents(j))
push!(possible_overlaps[i], j)
@@ -162,7 +166,7 @@ function deferred_label_context(geom::LabelGeometry,
# Propose a change to label placement.
else
if !label_visibility[j]
- new_total_penalty -= theme.label_hidden_penalty
+ new_total_penalty -= theme.label_hidden_penalty ### why?
end
r = rand()
@@ -224,7 +228,7 @@ function deferred_label_context(geom::LabelGeometry,
improvement = total_penalty - new_total_penalty
T = 0.1 * (1.0 - (k / (1 + num_iterations)))
- if improvement >= 0 || rand() < exp(improvement / T)
+ if improvement >= 0 || rand() < exp(improvement / T) ### ???
if propose_hide
label_visibility[j] = false
else
diff --git a/src/geom/line.jl b/src/geom/line.jl
index 2b5fa2a36..a9b1f3add 100644
--- a/src/geom/line.jl
+++ b/src/geom/line.jl
@@ -16,6 +16,19 @@ function LineGeometry(default_statistic=Gadfly.Stat.identity();
LineGeometry(default_statistic, preserve_order, order, tag)
end
+"""
+# Aesthetics
+- `x`: X-axis position.
+- `y`: Y-axis position.
+- `group` (optional): Group categorically.
+- `color` (optional): Group categorically and indicate by color.
+
+# Arguments
+- `preserve_order`: Default behavior for `Geom.line` is to draw lines between
+ points in order along the x-axis. If this option is true, lines will be
+ drawn between points in the order they appear in the data. `Geom.path()` is
+ `Geom.line(preserve_order=true)`.
+"""
const line = LineGeometry
function contour(; levels=15, samples=150, preserve_order=true)
diff --git a/src/geom/point.jl b/src/geom/point.jl
index 664e87652..c2d652cb5 100644
--- a/src/geom/point.jl
+++ b/src/geom/point.jl
@@ -5,6 +5,16 @@ struct PointGeometry <: Gadfly.GeometryElement
end
PointGeometry(; tag=empty_tag) = PointGeometry(tag)
+"""
+Draw various types of scatterplots.
+
+# Aesthetics
+- `x`: X-axis position.
+- `y`: Y-axis position.
+- `color` (optional): Point color. Categorical data will choose maximally distinguishable colors from the LCHab color space. Continuous data will map onto LCHab as well. Colors can also be specified explicitly for each data point with a vector of colors of length(x). A vector of length one specifies the color to use for all points. Default is Theme.default_color.
+- `shape` (optional): Point shape. Categorical data will cycle through Theme.point_shapes. Shapes can also be specified explicitly for each data point with a vector of shapes of length(x). A vector of length one specifies the shape to use for all points. Default is Theme.point_shapes[1].
+- `size` (optional): Point size. Categorical data and vectors of Ints will interpolate between Theme.point_size_{min,max}. A continuous vector of AbstractFloats or Measures of length(x) specifies the size of each data point explicitly. A vector of length one specifies the size to use for all points. Default is Theme.point_size.
+"""
const point = PointGeometry
element_aesthetics(::PointGeometry) = [:x, :y, :size, :color, :shape]
diff --git a/src/guide.jl b/src/guide.jl
index 71d44707e..9aad86f21 100644
--- a/src/guide.jl
+++ b/src/guide.jl
@@ -881,6 +881,17 @@ struct XLabel <: Gadfly.GuideElement
end
XLabel(label; orientation=:auto) = XLabel(label, orientation)
+"""
+Sets the x-axis label for the plot.
+
+# Arguments
+- `label`: X-axis label
+- `orientation` (optional): `:horizontal`, `:vertical`, or `:auto` (default)
+
+`label` is not a keyword parameter, it must be supplied as the first
+argument of [Guide.xlabel](@ref). Setting it to `nothing` will suppress
+the default label.
+"""
const xlabel = XLabel
function render(guide::XLabel, theme::Gadfly.Theme,
@@ -942,6 +953,17 @@ struct YLabel <: Gadfly.GuideElement
end
YLabel(label; orientation=:auto) = YLabel(label, orientation)
+"""
+Sets the y-axis label for the plot.
+
+# Arguments
+- `label`: Y-axis label
+- `orientation` (optional): `:horizontal`, `:vertical`, or `:auto` (default)
+
+`label` is not a keyword parameter, it must be supplied as the first
+argument of `Guide.ylabel`. Setting it to `nothing` will suppress
+the default label.
+"""
const ylabel = YLabel
@@ -995,6 +1017,12 @@ struct Title <: Gadfly.GuideElement
label::Union{(Void), AbstractString}
end
+"""
+Set the plot title.
+
+# Arguments
+- `title`: Plot title
+"""
const title = Title
function render(guide::Title, theme::Gadfly.Theme,