Package org.ujmp.core.util
Class GnuPlot
- java.lang.Object
-
- org.ujmp.core.util.GnuPlot
-
public class GnuPlot extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.BufferedReader
error
private static GnuPlot
gnuPlot
private java.lang.Process
gnuPlotProcess
private java.io.BufferedReader
input
private static java.io.File
matrixFile
private java.io.BufferedWriter
output
private static java.lang.String
pathToGnuPlot
private boolean
running
static java.lang.String[]
SEARCH
-
Constructor Summary
Constructors Modifier Constructor Description private
GnuPlot(java.lang.String pathToGnuPlot)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.String command)
void
exportToFIG(java.io.File file, java.lang.Object... parameters)
void
exportToPNG(java.io.File file, java.lang.Object... parameters)
void
exportToPS(java.io.File file, java.lang.Object... parameters)
void
exportToSVG(java.io.File file, java.lang.Object... parameters)
private static java.lang.String
findGnuPlot()
private java.lang.String
getFromGnuPlot()
static GnuPlot
getInstance()
static GnuPlot
getInstance(java.lang.String pathToGnuPlot)
static java.lang.String
getPlotCommand(Matrix matrix, boolean withlines, boolean withpoints)
static boolean
isAvailable()
void
plot(Matrix matrix, java.lang.String... format)
void
scatterPlot(Matrix matrix, java.lang.String... format)
private void
sendToGnuPlot(java.lang.String command)
void
setMatrix(java.lang.String label, Matrix matrix)
void
shutdown()
static java.lang.String
toString(java.lang.String[] strings)
-
-
-
Field Detail
-
SEARCH
public static java.lang.String[] SEARCH
-
pathToGnuPlot
private static java.lang.String pathToGnuPlot
-
input
private java.io.BufferedReader input
-
output
private java.io.BufferedWriter output
-
error
private java.io.BufferedReader error
-
gnuPlotProcess
private java.lang.Process gnuPlotProcess
-
running
private boolean running
-
gnuPlot
private static GnuPlot gnuPlot
-
matrixFile
private static java.io.File matrixFile
-
-
Method Detail
-
getInstance
public static GnuPlot getInstance() throws java.lang.Exception
- Throws:
java.lang.Exception
-
findGnuPlot
private static java.lang.String findGnuPlot()
-
getInstance
public static GnuPlot getInstance(java.lang.String pathToGnuPlot) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getFromGnuPlot
private java.lang.String getFromGnuPlot() throws java.lang.Exception
- Throws:
java.lang.Exception
-
execute
public void execute(java.lang.String command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
shutdown
public void shutdown() throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendToGnuPlot
private void sendToGnuPlot(java.lang.String command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setMatrix
public void setMatrix(java.lang.String label, Matrix matrix) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isAvailable
public static boolean isAvailable()
-
plot
public void plot(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPlotCommand
public static java.lang.String getPlotCommand(Matrix matrix, boolean withlines, boolean withpoints)
-
scatterPlot
public void scatterPlot(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public static java.lang.String toString(java.lang.String[] strings)
-
exportToPS
public void exportToPS(java.io.File file, java.lang.Object... parameters) throws java.lang.Exception
- Throws:
java.lang.Exception
-
exportToPNG
public void exportToPNG(java.io.File file, java.lang.Object... parameters) throws java.lang.Exception
- Throws:
java.lang.Exception
-
exportToFIG
public void exportToFIG(java.io.File file, java.lang.Object... parameters) throws java.lang.Exception
- Throws:
java.lang.Exception
-
exportToSVG
public void exportToSVG(java.io.File file, java.lang.Object... parameters) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-