Skip to content

How to plot an 1D java array using Kakadu_124059877

nxi edited this page Apr 9, 2015 · 1 revision

Gumtree : How to plot an 1D java array using Kakadu

Created by Tony Lam, last modified on Jul 06, 2009
Kakadu provides Eclipse view to plot dataset using Kuranda. The following code illustrates how we can create a Kakadu plot from a Java 1D array.
// Create a java primitive array
double [] array = new double [] {1, 2, 3, 4});

// Create axis information
double [] axis = new double [] {0, 1, 2, 3});

// Create new plot objecy
Plot plot = (Plot) PlotFactory.createPlot("Data", DataDimensionType.pattern);
plot.addData("Data", Factory.createArray(array, "Y", "arbitrary unit");
plot.addAxis("axis", Factory.createArray(axis, "X", "arbitrary unit", 0);

// Plot it using Kakadu
PlotDOM.plot(plot);
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally