Simple Java Plot
yuriy-g's Simple Java Plot,
as the name suggests, offers a small
number of useful plotting features which can be mastered
just by looking at a few examples, and at the
source code.
These include:
- Line charts, scatter charts, and bar charts;
- Multiple x/y axes;
- An optional legend;
- Line types (solid, dashed, none);
- Marker types (square, circle, diamond, bar, column, none);
- Area plots.
If you're looking for a more feature-rich, and more complicated,
library, then
JFreeChart
should fit the bill.
My Examples
Click on a chart image to load a bigger version:
- MinimalPlots.java:
A line plot, scatter plot, and
bar chart using the same
data, and a scatter plot of data loaded from a
text file.
- LinePlots.java:
Four line plots on the same graph, using two y-axes.
A legend is included, and the x-axis is formatted in
Hours:Minutes:Seconds. The plot is displayed
and saved to a file.
- ScatterPlots.java:
Two scatter plots drawn on one graph using differently
shaped markers and colors. The legend is positioned above
the graph.
- BarPlots.java:
A graph using column and row bars.
- AllOptsPlot.java:
A graph showing all the possible options for
the plot, the data, and the axes.
- Utils.java: methods for
- generating simple line, scatter, and bar plots;
- viewing a plot in a window;
- loading plot data from a file;
- calculating coordinate data ranges.
- ImageViewer.java:
displays an image in a JPanel.
Downloads and Other Links
Dr. Andrew Davison
E-mail: ad@coe.psu.ac.th
Back to the third-party libraries page