aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scalam/plotting/Plotter.scala
diff options
context:
space:
mode:
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))