examples.plotting.example5.example.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jstat Show documentation
Show all versions of jstat Show documentation
Java Library for Statistical Analysis.
The newest version!
# Example 5: Scatter Plot
## Contents
* [Overview](#overview)
* [Import files](#include_files)
* [The main function](#m_func)
* [Results](#results)
* [Source Code](#source_code)
## Overview
## Import files
```
import dataloader.CsvDataLoader;
import tech.tablesaw.api.Table;
import visualizations.ScatterChart;
import java.io.File;
import java.io.IOException;
```
## The main function
```
public class Example5 {
public static void main(String[] args) throws IOException {
File file = new File("data/humans_data.csv");
Table data = CsvDataLoader.TableLoader.parseFile(file);
ScatterChart plotter = new ScatterChart();
ScatterChart.ScatterChartOptions options = plotter.new ScatterChartOptions();
options.chartTitle = "weight by age and height";
options.xAxisName = "Age";
options.yAxisName = "Height";
options.sizeColName = "Weight";
ScatterChart.plotScatter3D(options, data);
}
}
```
## Results
```
```
## Source Code
Example5.java