package plot
Basic 2-d plotting package. This API is very experimentable, I reserve the right to change everything.
- Alphabetic
- By Inheritance
- plot
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class CategoricalPaintScale[T](categories: (T) => Paint) extends PaintScale[T] with Product with Serializable
Maps items to colors using the given partial function.
Maps items to colors using the given partial function. If no color is provided for the given item, then returns PaintScale.nanPaint.
- case class CategoricalPaintScaleFactory[T]() extends PaintScaleFactory[T] with Product with Serializable
Creates a categorical paint scale using the Category20 palette borrowed from Protovis.
Creates a categorical paint scale using the Category20 palette borrowed from Protovis. http://vis.stanford.edu/protovis/docs/color.html
Beware that category colors can be reused if the number of distinct items is greater than 20.
- trait DomainFunction[T, K, +V] extends AnyRef
Represents a "function" T that knows its (finite) domain, and can also be applied.
Represents a "function" T that knows its (finite) domain, and can also be applied. Typeclass.
- case class DynamicHistogramBins(number: Int = 10) extends HistogramBins with Product with Serializable
Create a set of StaticHistogramBins from a number and an (eventual) lower and upper bound.
- class Figure extends AnyRef
- case class GradientPaintScale[T](lower: T, upper: T, gradient: Array[Color] = PaintScale.WhiteToBlack)(implicit view: Conversion[T, Double]) extends PaintScale[T] with Product with Serializable
A simple numeric paint scale for mapping a number within a range to a corresponding element of a pre-computed color gradient.
A simple numeric paint scale for mapping a number within a range to a corresponding element of a pre-computed color gradient. Colors from the given gradient array are used linearly to represent values between lower and upper.
- case class GradientPaintScaleFactory[T](gradient: Array[Color] = PaintScale.WhiteToBlack)(implicit view: Conversion[T, Double]) extends PaintScaleFactory[T] with Product with Serializable
Creates a GradientPaintScale from the min and max of a set of data points.
Creates a GradientPaintScale from the min and max of a set of data points. bound are supplied.
- sealed trait HistogramBins extends AnyRef
Bins for a histogram.
Bins for a histogram. These can be implicitly constructed from:
x : HistogramBins = 10 // 10 dynamically determined histogram bins x : HistogramBins = Array(1.0,2.0,3.2) // five buckets wit the given splits x : HistogramBins = (0,100,10) // ten bins evenly dividing 0 to 100.
- sealed trait PaintScale[T] extends (T) => Paint
Maps items of type T to a well defined Paint (usually a color).
Maps items of type T to a well defined Paint (usually a color).
An implicit conversion exists to make a singleton PaintScaleFactory from a PaintScale instance, which means that PaintScales can be provided directly whenever a PaintScaleFactory is required.
- trait PaintScaleFactory[T] extends (Traversable[T]) => PaintScale[T]
Constructs a PaintScale for the given type T by examining a set of its values.
- class Plot extends AnyRef
Maintains a set of series (or more strictly, the data from those series) and the necessary JFreeChart stuff to plot them.
- trait Series extends AnyRef
A Series is anything that can be added to a breeze.plot.Plot and plotted
- case class StaticHistogramBins(splits: Array[Double]) extends HistogramBins with Product with Serializable
Set of histograms for binning data using the given splits.
- class XYDataset[Item] extends AbstractXYDataset
An XY dataset consisting of some number of named series, each consisting of items of type Item, with an associated x value, y value, and optionally a name and tooltip.
- class XYZDataset[Item] extends AbstractXYZDataset
An XYX dataset consisting of some number of named series, each consisting of items of type Item, with an associated x value, y value, z value, and optionally a name and tooltip.
Value Members
- def hist[D, K, V](data: D, bins: HistogramBins = 10, name: String = null)(implicit xv: DomainFunction[D, Int, V], vv: (V) => Double): Series
Plots a histogram of the given data into the given number of bins
- def image[M, V](img: Matrix[Double], scale: GradientPaintScale[Double] = null, name: String = null, offset: (Int, Int) = (0, 0), labels: PartialFunction[(Int, Int), String] = null.asInstanceOf[PartialFunction[(Int, Int), String]], tips: PartialFunction[(Int, Int), String] = null.asInstanceOf[PartialFunction[(Int, Int), String]]): Series
Displays an image in the current figure, where each cell in the matrix provides color for one square of the image.
Displays an image in the current figure, where each cell in the matrix provides color for one square of the image.
- img
A matrix containing the colors to plot
- scale
Scale used for converting matrix values to colors.
- name
Series name
- offset
Offset for indexing the top-left corner of the matrix
- labels
Labels for some subset of the data points
- tips
Tooltip popups for some subset of the data points
- def plot[X, Y, V](x: X, y: Y, style: Char = '-', colorcode: String = null, name: String = null, lines: Boolean = true, shapes: Boolean = false, labels: (Int) => String = null.asInstanceOf[Int => String], tips: (Int) => String = null.asInstanceOf[Int => String])(implicit xv: DomainFunction[X, Int, V], yv: DomainFunction[Y, Int, V], vv: (V) => Double): Series
Plots the given y versus the given x with the given style.
Plots the given y versus the given x with the given style.
- x
X-coordinates, co-indexed with y (and indexed by keys of type K).
- y
Y-coordinates, co-indexed with x (and indexed by keys of type K).
- style
Matlab-like style spec of the series to plot.
- name
Name of the series to show in the legend.
- labels
Optional in-graph labels for some points.
- tips
Optional mouse-over tooltips for some points.
- def scatter[X, V, Y, YV](x: X, y: Y, size: (Int) => Double, colors: (Int) => Paint = null.asInstanceOf[Int => Paint], labels: (Int) => String = null.asInstanceOf[Int => String], tips: (Int) => String = null.asInstanceOf[Int => String], name: String = null)(implicit xv: DomainFunction[X, Int, V], yv: DomainFunction[Y, Int, V], vv: (V) => Double): Series
Displays a scatter plot of x versus y, each point drawn at the given size and mapped with the given color.
Displays a scatter plot of x versus y, each point drawn at the given size and mapped with the given color.
Example usage: https://gist.github.com/1288473
- x
The x coordinates to draw as provided by anything that can be seen as a Tensor1.
- y
The y coordinates to draw as provided by anything that can be seen as a Tensor1.
- size
The size of each circle (on the same scale as the domain axis)
- labels
Labels to draw next to each point.
- tips
Tooltips to show on mouseover for each point.
- name
Series name for legend
- object DomainFunction
- object ExportGraphics
Utility functions for exporting a Graphics2D drawable to some eps, pdf, and png.
- object Figure
- object HistogramBins
Static constructors for HistogramBins.
- object PaintScale
- object PaintScaleFactory
- object Plot
- object XYDataset extends Serializable
- object XYZDataset extends Serializable