Documentation
¶
Overview ¶
Package guide provides axis, legend, and title rendering for plots. Guides are the non-data visual elements that border the plotting area and help readers interpret the data.
Index ¶
- func DrawColorBar(cv canvas.Canvas, spec ColorBarSpec, x, y, barH float64, th theme.Theme)
- func DrawColorBarHorizontal(cv canvas.Canvas, spec ColorBarSpec, x, y, barW float64, th theme.Theme)
- func DrawGrid(cv canvas.Canvas, xScale, yScale scale.Scale, x, y, w, h float64, ...)
- func DrawLegend(cv canvas.Canvas, title string, entries []LegendEntry, x, y float64, ...)
- func DrawLegendHorizontal(cv canvas.Canvas, title string, entries []LegendEntry, x, y, maxW float64, ...)
- func DrawXAxis(cv canvas.Canvas, sc scale.Scale, label string, x, y, w float64, ...)
- func DrawYAxis(cv canvas.Canvas, sc scale.Scale, label string, x, y, h float64, ...)
- type ColorBarSpec
- type LegendEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawColorBar ¶
DrawColorBar renders a continuous color bar legend at the given position. The bar is drawn vertically (top = max, bottom = min) as in ggplot2.
func DrawColorBarHorizontal ¶
func DrawColorBarHorizontal(cv canvas.Canvas, spec ColorBarSpec, x, y, barW float64, th theme.Theme)
DrawColorBarHorizontal renders a horizontal continuous color bar legend.
func DrawGrid ¶
DrawGrid renders major grid lines in the data area, first filling the panel background with the theme's Panel.Background color. Grid lines use the theme's DashPattern (nil = solid, e.g. {4,4} = dashed).
func DrawLegend ¶
func DrawLegend(cv canvas.Canvas, title string, entries []LegendEntry, x, y float64, th theme.Theme)
DrawLegend renders a categorical legend to the right of the data area.
func DrawLegendHorizontal ¶
func DrawLegendHorizontal(cv canvas.Canvas, title string, entries []LegendEntry, x, y, maxW float64, th theme.Theme)
DrawLegendHorizontal renders a categorical legend as a horizontal row.
Types ¶
type ColorBarSpec ¶
ColorBarSpec describes a continuous color bar legend.
Cmap and Norm replace the previous opaque ColorFunc field: the bar walks Cmap.At directly across the [0,1] range, and Norm provides the data-space labels at the endpoints (and any future intermediate ticks).
type LegendEntry ¶
LegendEntry describes one item in the legend.