diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/scala/scalam/plotting/DataSet.scala | 4 |
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") |