aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2012-11-04 22:58:38 +0100
committerJakob Odersky <jodersky@gmail.com>2012-11-04 22:58:38 +0100
commitf4c459badea01411661d69689341e8bc10109ed7 (patch)
treeb10016e2d73ed980b671822bf08e8620d9416596
parentc40910c72193f64d797e8416b0dfa4fb89688c98 (diff)
downloadscalam-f4c459badea01411661d69689341e8bc10109ed7.tar.gz
scalam-f4c459badea01411661d69689341e8bc10109ed7.tar.bz2
scalam-f4c459badea01411661d69689341e8bc10109ed7.zip
add alternative constructors to DataSet
-rw-r--r--src/main/scala/scalam/plotting/DataSet.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/scala/scalam/plotting/DataSet.scala b/src/main/scala/scalam/plotting/DataSet.scala
index 5125478..381bf00 100644
--- a/src/main/scala/scalam/plotting/DataSet.scala
+++ b/src/main/scala/scalam/plotting/DataSet.scala
@@ -21,6 +21,10 @@ case class DataSet(points: Seq[(Double, Double)], label: String, name: String) {
object DataSet {
def apply(points: Seq[(Double, Double)], label: String) = new DataSet(points, label, Identifier.makeValid(label))
+
+ def apply(xs: Seq[Double], ys: Seq[Double], label: String) = new DataSet(xs zip ys, label, Identifier.makeValid(label))
+
+ def apply(xs: Seq[Double], ys: Seq[Double], label: String, name: String) = new DataSet(xs zip ys, label, name)
implicit def dataSetIsSaveable(ds: DataSet) = new Saveable {
def save(out: scalax.file.Path) = for ((x, y) <- ds.points) yield out.write(x + " " + y + "\n")