aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scalam/plotting/DataSet.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/scalam/plotting/DataSet.scala')
-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")