SSJ
3.3.1
Stochastic Simulation in Java
|
This class provides tools to create charts from data in a simple way. More...
Public Member Functions | |
JFreeChart | getJFreeChart () |
Returns the JFreeChart object associated with this chart. More... | |
Axis | getYAxis () |
Returns the chart’s range axis ( \(y\)-axis) object. More... | |
abstract JFrame | view (int width, int height) |
Displays the chart on the screen using Swing. More... | |
String | getTitle () |
Gets the current chart title. More... | |
void | setTitle (String title) |
Sets a title to this chart. More... | |
void | setAutoRange () |
Sets chart \(y\) range to automatic values. | |
void | enableGrid (double xstep, double ystep) |
Puts a grid on the background. More... | |
void | disableGrid () |
Disables the background grid. | |
Protected Attributes | |
Axis | YAxis |
SSJCategorySeriesCollection | dataset |
JFreeChart | chart |
boolean | latexDocFlag = true |
boolean | autoRange |
double [] | manualRange |
boolean | grid = false |
double | ystepGrid |
final double | BOR = 0.1 |
Latex-specific methods | |
abstract String | toLatex (double width, double height) |
Transforms the chart into LaTeX form and returns it as a String . | |
void | setLatexDocFlag (boolean flag) |
Same as in XYChart. | |
double | computeYScale (double position) |
double | computeScale (double[] bounds) |
This class provides tools to create charts from data in a simple way.
Its main feature is to produce TikZ/PGF (see WWW link http://sourceforge.net/projects/pgf/) compatible source code which can be included in LaTeX documents, but it can also produce charts in other formats. One can easily create a new chart, and customize its appearance using methods of this class, with the encapsulated umontreal.ssj.charts.SSJCategorySeriesCollection object representing the data, and an umontreal.ssj.charts.Axis object representing the axis. All these classes depend on the JFreeChart
API (see WWW link http://www.jfree.org/jfreechart/) which provides tools to build charts with Java, to draw them, and export them to files. However, only basic features are used here.
Moreover, CategoryChart
provides methods to plot data using a MATLAB friendly syntax. None of these methods provides new features; they just propose a different syntax to create charts. Therefore some features are unavailable when using these methods only.
void enableGrid | ( | double | xstep, |
double | ystep | ||
) |
Puts a grid on the background.
It is important to note that the grid is always shifted in such a way that it contains the axes. Thus, the grid does not always have an intersection at the corner points; this occurs only if the corner points are multiples of the steps: xstep
and ystep
sets the step in each direction.
xstep | sets the step in the x-direction. |
ystep | sets the step in the y-direction. |
JFreeChart getJFreeChart | ( | ) |
Returns the JFreeChart
object associated with this chart.
String getTitle | ( | ) |
Gets the current chart title.
Axis getYAxis | ( | ) |
Returns the chart’s range axis ( \(y\)-axis) object.
void setTitle | ( | String | title | ) |
Sets a title to this chart.
This title will appear on the chart displayed by method view.
title | chart title |
|
abstract |
Displays the chart on the screen using Swing.
width | frame width |
height | frame height |