113
JFreeChart- Scatter Chart
A scatter chart or plot contains a set of data points plotted on horizontal and vertical axes. It displays data from a XYDataset.
The following images show some of the demo versions of Scatter chart incorporated in JFreeChart library:
Scatter Plot Demo 1:
Scatter Plot Demo 2:
Scatter Plot Demo 3:
Scatter Plot example:
Let us consider the following sample data for a scatter plot.
Boys (Series 1) | Girls (Series 2) | ||
---|---|---|---|
Age | Weight | Age | Weight |
1 | 72.9 | 1 | 72.5 |
2 | 81.6 | 2 | 80.1 |
3 | 88.9 | 3 | 87.2 |
4 | 96 | 4 | 94.5 |
5 | 102.1 | 5 | 101.4 |
6 | 108.5 | 6 | 107.4 |
7 | 113.9 | 7 | 112.8 |
8 | 119.3 | 8 | 118.2 |
9 | 123.8 | 9 | 122.9 |
10 | 124.4 | 10 | 123.4 |
The following codes create a scatter plot from the above sample data:
ScatterPlotExample.java
Output:
Next TopicJfreeChart-Bubble Chart