aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scalam/plotting/Plotter.scala
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2012-11-06 12:25:47 +0100
committerJakob Odersky <jodersky@gmail.com>2012-11-06 12:25:47 +0100
commitb6c4fd039f1c8904b6342260911f36f49041466e (patch)
tree09dbd184ff208ec9b13daaf7e80450ee6ab2e5ad /src/main/scala/scalam/plotting/Plotter.scala
parent96d06b8c26d0773c0dcef737e2541ebcd104dc60 (diff)
downloadscalam-b6c4fd039f1c8904b6342260911f36f49041466e.tar.gz
scalam-b6c4fd039f1c8904b6342260911f36f49041466e.tar.bz2
scalam-b6c4fd039f1c8904b6342260911f36f49041466e.zip
add axis scale support
Diffstat (limited to 'src/main/scala/scalam/plotting/Plotter.scala')
-rw-r--r--src/main/scala/scalam/plotting/Plotter.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/scala/scalam/plotting/Plotter.scala b/src/main/scala/scalam/plotting/Plotter.scala
index 199827c..0f9c151 100644
--- a/src/main/scala/scalam/plotting/Plotter.scala
+++ b/src/main/scala/scalam/plotting/Plotter.scala
@@ -4,12 +4,14 @@ import scalam.m._
import scalam.m.ast._
import scalam.m.interpretation.MInterpreter
import scalax.file.Path
+import scalam.plotting.scale.Scale
+import scalam.plotting.scale.Lin
trait Plotter { self: MInterpreter =>
import Plotter._
- def plot(dataSets: Seq[DataSet], title: String, x: String, y: String, grid: Boolean = true, legend: Boolean = true)(implicit styles: Seq[Style[StyleElement]] = defaultStyles, fontSize: FontSize = defaultFontSize) = {
- val plot = new Plot(dataSets, title, x, y, grid, legend, styles = styles, fontSize = fontSize.fontSize)
+ def plot(dataSets: Seq[DataSet], title: String, x: String, y: String, scales: (Scale, Scale) = (Lin, Lin), grid: Boolean = true, legend: Boolean = true)(implicit styles: Seq[Style[StyleElement]] = defaultStyles, fontSize: FontSize = defaultFontSize) = {
+ val plot = new Plot(dataSets, title, Axis(x, scales._1), Axis(y, scales._2), grid, legend, styles = styles, fontSize = fontSize.fontSize)
val path = Path(Identifier.makeValid(title))
scalam.io.save(plot, path)
val s = Function(Identifier("run"), StringLiteral((path / Plot.PlotFileName).path))