hi,
What is the difference between overlaid plots and TrendLines.
or is both of them are same.
thanks,
Kishore
overlaid plots Vs TrendLines
Re: overlaid plots Vs TrendLines
Hi Kishore,
Overlaid plots allow you to draw two or more plots in the same space.
Why would you want to do this? The main reason is that a plot has a single renderer, which means that all the data series are drawn the same way (as lines, or as shapes, or as bars etc). If you want to combine (say) a scatter plot with a trend line, then you need to overlay two plots, each plot having a different renderer.
Regards,
DG
Overlaid plots allow you to draw two or more plots in the same space.
Why would you want to do this? The main reason is that a plot has a single renderer, which means that all the data series are drawn the same way (as lines, or as shapes, or as bars etc). If you want to combine (say) a scatter plot with a trend line, then you need to overlay two plots, each plot having a different renderer.
Regards,
DG
Re: overlaid plots Vs TrendLines
Hi DG,
Thanks a lot for u'r Prompt Response.one more help.is it possible for you to provide me an example, containing a trend line over the scatter plot.
Thanks,
Kishore.
Thanks a lot for u'r Prompt Response.one more help.is it possible for you to provide me an example, containing a trend line over the scatter plot.
Thanks,
Kishore.
Re: overlaid plots Vs TrendLines
If you look at the OverlaidXYPlot demo, and make the following one-line change:
// XYItemRenderer renderer1 = new VerticalXYBarRenderer(0.20);
XYItemRenderer renderer1 = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
...then you almost get what you want. You just need to make sure the other series represents a trend line, rather than random data as in this example.
There is another demo (RegressionDemo1.java) that shows how to add a linear or power regression line to a scatter plot. It is included in a special download only available to developers that have purchased the JFreeChart documentation.
Regards,
DG.
// XYItemRenderer renderer1 = new VerticalXYBarRenderer(0.20);
XYItemRenderer renderer1 = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
...then you almost get what you want. You just need to make sure the other series represents a trend line, rather than random data as in this example.
There is another demo (RegressionDemo1.java) that shows how to add a linear or power regression line to a scatter plot. It is included in a special download only available to developers that have purchased the JFreeChart documentation.
Regards,
DG.