I have two XYseries {(x,y1)} and {(x,y2)} that I can plot as two curves on an XY linechart without difficulties. However I would like to plot a graph of y1 against y2. I have created a series {(y1,y2)} but during creation the data points are sorted according to the first component values y1. This is not what I want. I need to keep the ordering of the points the same as in the original series.
As an example, for illustrative purposes only, I could have the two series {(t,sint)} and {(t,cost)} for 0=<t<2Pi. I would then like to plot {(y1,y2)}= {(sint, cost)} in the y1-y2 plane. The result should be a circle of radius 1.0.
Is there a simple way to do this?
XY line plot with non-monotone X-values
Re: XY line plot with non-monotone X-values
Hi James,
A simple way: implement your own XYDataset, since the DefaultXYDataset sorts the values.
use e.g.
extends AbstractSeriesDataset implements XYDataset
and do the rest...
I have allready done this for my own purpose, and it works fine.
I have 200 random values positively correlated by 0.5 (i would say), plotted
with a line with nice alpha transparency. Looks like art - but was in fact a mistake (i did not want to plot a line, but shapes)
Regards,
Andreas Schroeder
A simple way: implement your own XYDataset, since the DefaultXYDataset sorts the values.
use e.g.
extends AbstractSeriesDataset implements XYDataset
and do the rest...
I have allready done this for my own purpose, and it works fine.
I have 200 random values positively correlated by 0.5 (i would say), plotted
with a line with nice alpha transparency. Looks like art - but was in fact a mistake (i did not want to plot a line, but shapes)

Regards,
Andreas Schroeder
Re: XY line plot with non-monotone X-values
Hello Andreas,
Thanks for the suggestion. It is very helpful as I have only just started using JFreeChart.
Regards,
James
Thanks for the suggestion. It is very helpful as I have only just started using JFreeChart.
Regards,
James