public class GnuplotContext extends Object implements PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
PlotContext
.Modifier and Type | Class and Description |
---|---|
static class |
GnuplotContext.Gnuplot
An internal implementation of
Plot . |
Modifier and Type | Field and Description |
---|---|
protected static String[] |
gnuplotExecArgs
An array of operating system dependent arguments to execute Gnuplot.
|
static String |
PROPERTY_COLORMAP
The property that toggles the colormap.
|
static String |
PROPERTY_GRID
The property that toggles the grid.
|
static String |
PROPERTY_LEGEND
The property that toggles the legend.
|
static String |
PROPERTY_MESH
The property that toggles the mesh.
|
Constructor and Description |
---|
GnuplotContext()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
GnuplotContext.Gnuplot |
addPlot(Plottable plottable)
Creates a
Plot at the given coordinates. |
GnuplotContext.Gnuplot |
addPlot(RealArray... datasets)
Creates a
Plot at the given coordinates. |
protected static String |
createLineStyleDefinition(DataStyle style)
Creates a Gnuplot line style definition from the given
DataStyle . |
GnuplotContext |
setFont(String fontName,
int fontSize)
Sets the font and size.
|
GnuplotContext |
setOutputFormat(String outputFormat)
Sets the output format.
|
GnuplotContext |
setOutputSize(int outputWidth,
int outputHeight)
Sets the output size.
|
void |
toFile(File file)
Exports to a file.
|
String |
toString()
Creates Gnuplot directives for rendering this context.
|
protected static final String[] gnuplotExecArgs
public static final String PROPERTY_LEGEND
public static final String PROPERTY_GRID
public static final String PROPERTY_MESH
public static final String PROPERTY_COLORMAP
public GnuplotContext.Gnuplot addPlot(Plottable plottable)
PlotContext
Plot
at the given coordinates.addPlot
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
plottable
- the Plottable
.public GnuplotContext.Gnuplot addPlot(RealArray... datasets)
PlotContext
Plot
at the given coordinates.addPlot
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
datasets
- the datasets.public void toFile(File file) throws IOException
PlotContext
toFile
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
file
- the file.IOException
- when something goes awry.public String toString()
public GnuplotContext setFont(String fontName, int fontSize)
PlotContext
setFont
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
fontName
- the font name.fontSize
- the font size.public GnuplotContext setOutputFormat(String outputFormat)
PlotContext
setOutputFormat
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
outputFormat
- the output format.public GnuplotContext setOutputSize(int outputWidth, int outputHeight)
PlotContext
setOutputSize
in interface PlotContext<GnuplotContext,GnuplotContext.Gnuplot>
outputWidth
- the output width.outputHeight
- the output height.