scatterplot (do not connect xyplot points)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Chad

scatterplot (do not connect xyplot points)

Post by Chad » Mon Jul 16, 2001 6:15 pm

Hello,

I'm learning how to use this package, and I would like to make a scatter plot.

What I've done is use the XYDataSource to create a xyChart. I've kinda based the code on the example:

XYDataSource myXYSource = new DefaultXYDataSource(data);
JFreeChart xyChart = JFreeChart.createXYChart(myXYSource);
//set title...
Plot xyPlot = xyChart.getPlot();
//set axis and view it.

I'm a novice programmer, so I may be missing something. When I view the chart, the data points are connected, but I'd like to have a scatter plot, without the points connected.

Can I do that?

Thanks in advance.
Chad

David Gilbert

RE: scatterplot (do not connect xyplot points)

Post by David Gilbert » Mon Jul 16, 2001 8:18 pm

Hi Chad,

You can't do a scatter plot in JFreeChart yet, but it's got to be pretty easy to modify the XYPlot to do the job. The trick is to find some reasonably general way of defining the shapes that you use to mark the points on each series, then all you need to do is modify the draw(...) method in XYPlot (and rename the class ScatterPlot).

Someone sent me some code recently for exactly that, although the shapes are hard coded. I'll try and get it added to the site (and CVS on SourceForge) this week...

Regards,

DG.

Chad

RE: scatterplot (do not connect xyplot points)

Post by Chad » Wed Jul 18, 2001 6:14 pm

Thanks,

Also though, on a line graph, is there a way to increase the size of the points. The line is thin, but I'd like to have bolder, points.

To do this, do you have to again 'find some reasonaly general way of defining the shapes that you use to mark the points on each series'?

I'll keep an eye out for the code being added to the site.

Thanks again,
Chad

Locked