arjeneh / jpowder

Automatically exported from code.google.com/p/jpowder
1 stars 0 forks source link

Lines move when plotting large dataset 3D #76

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Plot 3D for example the test dataset zopdih_dehy_RampNo1_4.xye
2. For the window containing the data resize this window horizontally
3. Notice the lines moves, and least this is observed on Kreecha and Anders PCs

A possible course of this problem is that when plotting e.g. 1000 data points 
in the horizontal direction (i.e. x-axis direction), where
this area may only contain 200 pixels in that direction, then JFreeChart sets a 
minimum blockwidth for each datapoint which means
the blockwidths start to overlap. 

For info, currently the place where we control the blockwidht
is in FilesPlotter3D, where the following code

        if (dataset.getSeriesCount() >= 1) {
            double width1stDataPoint = dataset.getXValue(0, 1) - dataset.getXValue(0, 0);
            if (width1stDataPoint <= 0.0) {
                width1stDataPoint = 1.0;
            }
            renderer.setBlockWidth(width1stDataPoint);

currently sets the blockwidth so that the blockwidht line up exactly (just 
touch each other)

Suggestion for solving this:

1. Plot around with plotting dataset of different number of data points to get 
a better feeling for how large a dataset needs to be before the lines starts to 
move

2. Perhaps consider debug into the JFreeChart when a large dataset is plotted 
to see if code in JFreeChart manually modify the value for the blockwidth which 
we set (because it thinks it is too small) without letter us know

What is the expected output? What do you see instead?

That the lines do not move when window resized

Original issue reported on code.google.com by anders.m...@stfc.ac.uk on 27 Oct 2012 at 8:30

GoogleCodeExporter commented 9 years ago
After some investigation - this 'bug' will take some work to fix fully. 
However, we
could provide a temporary, less good fix, which would be:

When reading data for 3D plotting and the number of data points is higher than 
say 100 then artificially force these data points to fit within 100 bin widths. 
Say the number of data points is N > 100 then bin these data within 100 bin 
widths. Take the example of N=1000. Splitting 1000 data points into 100 bins 
means that each bin will be the average of N/100 = 10 data points.

However, this is a somewhat desparate short term fix. 

The proper way of doing it would be that we keep the data as it, but present 
different views of the data depending on how big the chart is on the screen, 
this would require some work to get it right 

Original comment by and...@markvardsen.net on 17 Nov 2012 at 8:36