Plot2DPanel.addLinePlot plots double[] x, double[] y plots differently depending on length of array
What steps will reproduce the problem?
1. Plot2DPanel.addLinePlot("", new double[]{1,2,3}, new double[] {4,5,6})
2. Plot2DPanel.addLinePlot("", new double[]{1,2}, new double[] {4,5})
3.
What is the expected output? What do you see instead?
according to the arguments (String, double[] X, double[] Y), #1 should be
plotting the follow data points(1,4), (2,5), (3,6) and #2 should plot (1,4) and
(2,5).
This does not happen for #2. #2 plots (1,2) and (4,5).
What version of the product are you using? On what operating system?
8/2009 download, XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 1 Apr 2011 at 7:46
I've also seen this problem when adding multiple line plots to 2D and also 3D
every now and then. I'm trying to track down the issue that causes it.
Currently I would guess it's when the X and Y arrays have only 2 elements.
Original comment by [email protected] on 13 Sep 2011 at 7:56
I believe the problem is here: Plot2DCanvas.convertXY(double[]...XY)
Even though someone clearly coded this intentionally, I think this should be
removed. It's not documented, and it's not consistent.
Original comment by [email protected] on 5 Oct 2011 at 7:22
[deleted comment]
[deleted comment]
I had also this problem when I was trying to add multiple line plots. I
experimented a lot with this bug and it only emerges in 2X2 arrays.
Original comment by [email protected] on 16 Mar 2012 at 5:04
Great, I just wasted an entire day trying to trying to figure out why my
plots/derivations where messed up...
It is indeed because I was throwing 2x2 arrays at addScatterPlot()...
I'd suggest raising the priority level of this issue as plotting a pair of
points is a rather common elementary test.
Unfortunately, this broke my trust in jmathplot...
Original comment by [email protected] on 9 Oct 2013 at 2:17
Hey guys, this is indeed a bug, and it's shame such important bug is not fixed yet. We found a workaround for now to use 2x3 instead of 2x2. How to do this? Just by duplicating end of line point - it simply works.