title: y_discrete author: Daniel Jones part: Scale order: 2002 ...
Map data categorical to cartesian coordinates. Unlike Scale.y_continuous
, each
unique y value will be mapped to a equally spaced positions, regardless of
value.
By default continuous scales are applied to numerical data. If data consists of
numbers specifying categories, explititly adding Scale.y_discrete
is the
easiest way to get that data to plot appropriately.
y
, ymin
, ymax
, yintercept
using RDatasets
using Gadfly
Gadfly.prepare_display()
Gadfly.set_default_plot_size(12cm, 8cm)
srand(1234)
# Tread numerical y data as categories
plot(x=rand(10), y=rand(5), Scale.y_discrete)