aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/scalam/plotting/Plotter.scala16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/main/scala/scalam/plotting/Plotter.scala b/src/main/scala/scalam/plotting/Plotter.scala
index cdc1ef3..199827c 100644
--- a/src/main/scala/scalam/plotting/Plotter.scala
+++ b/src/main/scala/scalam/plotting/Plotter.scala
@@ -2,32 +2,20 @@ package scalam.plotting
import scalam.m._
import scalam.m.ast._
-import scalam.plotting.styles._
import scalam.m.interpretation.MInterpreter
-import scalam.m.interpretation.MatlabInterpreter
import scalax.file.Path
-trait Plotter {
+trait Plotter { self: MInterpreter =>
import Plotter._
- val pwd: scalax.file.Path
-
- lazy val interpreter: MInterpreter = new MatlabInterpreter(pwd)
-
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)
val path = Path(Identifier.makeValid(title))
scalam.io.save(plot, path)
val s = Function(Identifier("run"), StringLiteral((path / Plot.PlotFileName).path))
- println(s.line)
- interpreter.evaluate(s)
+ self.evaluate(s)
}
- def exit() {
- interpreter.write("exit")
- interpreter.close()
- }
-
}
object Plotter {