Skip to content

Commit 407e981

Browse files
author
richetyann
committed
fix and robustness
1 parent be68628 commit 407e981

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jmathplot/src/org/math/plot/DataSelectPanel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ void autoSelectVariableParam() {
5757
String val = _data[0][i].toString();
5858
for (int j = 1; j < _data.length; j++) {
5959
if (!_data[j][i].toString().equals(val)) {
60-
System.err.println(_data[j][i] + " != " + val);
60+
//System.err.println(_data[j][i] + " != " + val);
6161
constant = false;
6262
break;
6363
}
6464
}
65-
if (!constant) {
65+
if (!constant && _dimension > d) {
6666
if (d == 0) {
6767
selectAsX(i);
6868
d++;
@@ -660,7 +660,7 @@ public void actionPerformed(ActionEvent e) {
660660
yaxis.addActionListener(new AbstractAction() {
661661

662662
public void actionPerformed(ActionEvent e) {
663-
selectAsX();
663+
selectAsY();
664664
}
665665
});
666666
if (_dimension >= 2) {
@@ -771,7 +771,7 @@ public static void main(String[] args) {
771771
pp.setPreferredSize(new Dimension(400, 400));
772772
new FrameView(pp).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
773773

774-
Object[][] data = {{1, 3, 4, 5, "a0"}, {1, 3, 1, 1, "a1"}, {1, 3, 2, 2, "a2"}, {1, 3, 3, 3, "a5"}, {1, 3, 3, 3, "a3"}, {1, 3, 3, 4, "a2"}};
774+
Object[][] data = {{1, 3, 4, 5, "a0"}, {1, 3, 1, 1, "a1"}, {1, 3, 2, 2, "a2"}, {1, 3, 3, 3, "a5"}, {1, 3, 3, 3, "a3"}, {1.5, 3.5, 3, 4, "a2"}};
775775

776776
DataSelectPanel dsp3 = new DataSelectPanel(data, 3, "x1", "x2", "x3", "x4", "x5") {
777777

0 commit comments

Comments
 (0)