Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot2DCanvas and Plot3DCanvas merge columns incorrectly #2

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
- Plot2DCanvas:
When providing two arrays, one for X and for Y, each of length 2, to the 
Plot2DCanvas method "addScatterPlot(String, Color, double[], double[])", then 
the columns don't get merged to create an array of x-y pairs, but merely 
returned (see method "convertXY" in org.math.plot.canvas.Plot2DCanvas class). 
This means that the two arrays, listing x and y separately, get treated 
incorrectly as two x-y pairs instead.

- Plot3dCanvas:
When providing three arrays, one for X, one for Y and one for Z, each of length 
3, to the Plot3DCanvas method "addScatterPlot(String, Color, double[], 
double[], double[])", then the columns don't get merged to create an array of 
x-y-z triplets, but merely returned (see method "convertXYZ" in 
org.math.plot.canvas.Plot3DCanvas class). This means that the three arrays, 
listing x, y and z separately, get treated incorrectly as three x-y-z pairs 
instead.


What is the expected output? What do you see instead?
I've attached two source files that solely depend on the jmathplot library. 
Both of them will pop up two JFrames, one with the correct display and one with 
the incorrect display.
In the 2D case, it is immediately apparent, since the incorrect one displays 
the same min/max for the X and Y axes (10-50) instead of X:10-12 and Y:45-47.
And in the 3D case, it is easiest to turn them in such a way, that one looks 
onto the X-Y plane (= bird's view). The correct display has the axis ranges 
X:10-12 and Y:45-47, the incorrect one X:10-100 and Y:10-200.


What version of the product are you using? On what operating system?
Latest version from subversion/trunk. Linux (Centos 5.5 64-bit). Java 1.6.0_20 
64-bit.


Fix:
I've attached a patch file (plot_canvas.patch), generated from the current 
trunk in the subversion repository, that fixes this problem.

Original issue reported on code.google.com by fracpete on 28 Jun 2010 at 6:06

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant