Biplot Chart in JFreeChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
elendil
Posts: 4
Joined: Fri Mar 02, 2012 3:19 am
antibot: No, of course not.

Biplot Chart in JFreeChart

Post by elendil » Fri Mar 02, 2012 3:22 am

Hi! Is there a way to generate a biplot in JFreeChart? I browsed the API and this forum for native support in JFreeChart for biplot but I wasn't able to find one.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Biplot Chart in JFreeChart

Post by matinh » Fri Mar 02, 2012 8:04 am

Hi!

Currently (up to v1.0.14) there is no support for Biplots in JFreeChart. There is support for related ScatterPlots.
Feel free to implement Biplot support and contribute it back to JFreeChart :)

regards,
- martin

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Biplot Chart in JFreeChart

Post by matinh » Fri Mar 02, 2012 8:10 am

Having another thought brings up the following idea:
Scatter plots in JFreeChart use the XYDotRenderer on an XYPlot. You could probably create a biplot-chart by just adding another XYDataset and rendering it with a simple XYLineAndShapeRenderer.

hth,
- martin

PS: please let us know if it did work out.

elendil
Posts: 4
Joined: Fri Mar 02, 2012 3:19 am
antibot: No, of course not.

Re: Biplot Chart in JFreeChart

Post by elendil » Fri Mar 02, 2012 9:35 am

Hmm. Thanks. I'll try that method.

elendil
Posts: 4
Joined: Fri Mar 02, 2012 3:19 am
antibot: No, of course not.

Re: Biplot Chart in JFreeChart

Post by elendil » Tue Mar 06, 2012 2:21 am

I'm stumped. The XYDataset class in JFreeChart only allows double values? Here is a snippet of the data I am concerned with:

Code: Select all

Env	         Gen    Y
BH BOHOL PI	AZU	1.344
CR CARIMAGU	AZU	1.097
CV CAVINTI 	AZU	0.48375
I'm supposed to make a biplot from that. If I go about doing that using a scatter plot, I would have to separate Env and Gen into different plots initially.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Biplot Chart in JFreeChart

Post by matinh » Tue Mar 06, 2012 8:14 am

I'm stumped. The XYDataset class in JFreeChart only allows double values?
That's right. If you want non-number values you would have to use a CategoryPlot with a CategoryAxis. You would probably use the ScatterRenderer for this, like shown in in the JFreeChart demo-collection (Miscellaneous/ScatterRendererDemo1).

hth,
- martin

elendil
Posts: 4
Joined: Fri Mar 02, 2012 3:19 am
antibot: No, of course not.

Re: Biplot Chart in JFreeChart

Post by elendil » Thu Mar 08, 2012 2:05 am

Here is a sample chart generated using R. Can anyone guide on how to do this using JFreeChart?

Image

Post Reply