Plotting a datafile 3D set of scattered grid points

  Kiến thức lập trình

I’m new in matplotlib and I’m trying to plot a 3D set of scattered points from a datafile, modifying a script I’ve found elsewhere. I’m getting an error message but I don’t understand what’s going on. x-values go from -1 to 7 and y-values from 12 to 88.

The datafile is

 0.1     68  0.3
 0   64  0.1
 0.2     64  -0.2
 0.2     71  0.1
 0.2     72  0.2
 0   73  0.3
 0.1     70  0.3
 0.1     63  -0.3
 0.8     60  0.2
 1.6     54  -0.1
 1.7     65  -0.5
 1.4     77  0.2
 0.9     78  0.3
 0.6     75  0.4
 3.2     74  0
 2   77  0.1
 1.5     79  0.2
 0.8     77  0.2
 0.1     78  0.2
 0.5     79  0.2
 0.3     81  0.2
 0   83  0.3
 0.5     84  0.4
 1.9     84  0.4
 1.9     85  0.3
 1   85  0.4
 1.4     85  0.3
 1.6     84  0.4
 0.6     83  0.5
 1.5     80  0.4
 2.8     77  0.3
 3.3     74  0.3
 3.5     69  0.2
 3.3     73  0.2
 4   73  0.3
 3.7     66  0.4
 3.3     64  0
 3.3     62  0.1
 2.5     63  0.2
 2.5     64  0.2
 3   65  0.2
 2.5     66  0.2
 2.2     66  0.2
 3.9     61  0.2
 3.2     58  0.1
 2.1     60  0.1
 2   62  0
 3.1     64  0
 2.8     65  0.1
 4   65  0.1
 3.8     65  0.1
 4.1     65  0
 2.8     65  0.1
 1.3     64  0
 1.2     63  0.1
 1.8     65  0.2
 1.1     64  0.1
 0.2     64  0
 1.6     62  0
 1.1     61  -0.1
 0.5     60  -0.1
 0.3     63  0.3
 1.3     61  0.9
 2.3     57  0.7
 2.2     54  1
 1.6     49  1.1
 2.4     47  1.7
 2.1     42  1
 3.2     36  1.2
 3.3     35  0.5
 3.4     40  0.2
 3.2     38  0.8
 4.2     31  0.5
 4.8     34  0.7
 5.5     32  0.7
 5.1     33  0.6
 4.7     37  0.3
 4.3     41  0.6
 4.6     41  0.7
 4.5     42  0.6
 4.1     42  0.7
 3.5     41  0.5
 3.1     44  0.5
 2.9     46  0.3
 2.1     49  0.2
 2.4     52  0.1
 2.1     55  0.1
 1.8     57  0.1
 0.7     59  0
 0.1     61  -0.1
 0.5     63  0
 1.4     65  0
 0.4     67  0.2
 1.3     68  0.1
 1.7     71  0.2
 1.4     71  0.1
 2.2     73  0.2
 1.9     74  0.3
 1.3     72  0.2
 2.3     73  0.2
 2.7     74  0.2
 2.5     73  0.3
 1.3     73  0.2
 1   73  0.2
 2   74  0.2
 0.1     73  0.2
 0.9     72  0.3
 0.1     72  0.2
 0.2     71  0.2
 0.7     71  0.5
 0.4     70  0.4
 0.2     69  0.3
 0.2     67  0.5
 0.1     64  0.6
 0.5     60  0.8
 0.7     59  1
 0.2     54  0.4
 0.3     51  0.7
 0.4     49  0.6
 2.5     45  1.3
 1.6     43  1.1
 0.9     44  0.7
 1   43  0.6
 2.1     40  0.6
 2.9     37  0.8
 3.3     35  0.6
 4.6     34  0.7
 4.4     33  0.6
 4.1     32  0.6
 3.9     34  0.3
 3.1     38  0.3
 3   39  0.2
 2.6     42  0.2
 1.5     43  0.2
 1.4     46  0.2
 2.1     47  0.2
 0.8     48  0.2
 0.8     50  0.2
 0.4     52  0.1
 1   55  0.1
 0.5     58  0.1
 0.2     59  0
 0.1     61  0.1
 0.4     63  0
 0.6     65  0.2
 0.8     66  0
 1.5     69  0.3
 2.2     71  0.2
 1.8     72  0.3
 1.8     72  0.1
 2   74  0.2
 1.3     74  0.1
 1.4     75  0.3
 2.1     76  0.5
 2.4     75  0.4
 2.2     74  0.3
 2.2     73  0.5
 1.3     71  0.6
 0   68  0.5
 0   63  0.5
 0   61  0.4
 0.5     61  0.3
 0.3     62  0.5
 0   60  0.3
 0.1     57  0.5
 0.6     55  1.1
 0.2     50  0.7
 1   48  0.5
 1.8     48  0.7
 2.2     45  1
 3   42  1
 2.9     40  1
 3   42  0.8
 2.7     42  0.7
 3.4     41  0.8
 3.7     40  0.9
 4.5     42  0.6
 4   45  0.5
 3.7     46  0.5
 3.2     47  0.3
 2.3     50  0.1
 1.7     54  0.2
 2.1     56  0.1
 1.5     57  0.1
 0.7     58  0
 0.4     60  0
 1.2     65  -0.1
 1.3     67  0.1
 1.9     70  0.2
 1.8     71  0.1
 2.5     73  0.1
 2.3     74  0.2
 2.5     75  0.2
 2.6     75  0.2
 1.8     75  0.2
 2.1     76  0.2
 0.9     77  0.1
 1.2     78  0.1
 0.9     78  0.1
 1.1     79  0.2
 0.7     81  0.2
 0.6     81  0.1
 0.8     81  0.2
 0.2     81  0.3
 0.6     81  0.7
 0.1     78  0.8
 0   76  0.7
 0   72  0.3
 0.1     64  -0.1
 0.1     62  0.1
 0.2     58  0.4
 0.2     49  0.4
 0.4     42  0.3
 0.6     39  0.6
 1   36  0.6
 1.3     37  0.9
 1.2     35  0.8
 2.1     33  0.8
 3.1     32  0.9
 2.8     31  0.9
 2.5     32  0.9
 2.8     32  0.9
 2.7     33  1
 2.5     34  1.1
 2.9     38  0.8
 2.8     40  0.5
 3.7     45  0.4
 3.3     52  0.2
 3.1     56  0.2
 2.8     58  0.1
 1.8     60  0.1
 2.8     64  0
 2.4     66  0.2
 1.6     67  0.1
 1.2     69  0.1
 0.5     70  0.1
 0.8     71  0
 1.4     73  0.1
 1.4     75  0.2
 1.2     75  0.1
 0.9     76  0.2
 1   77  0.2
 1.4     78  0.2
 1.3     78  0.2
 1.3     79  0.2
 2   80  0.2
 1.2     81  0.2
 2.1     80  0.2
 1.4     81  0.2
 0.6     81  0.1
 0.9     80  0
 1.2     82  0.3
 1   81  0.5
 0.5     80  0.8
 0   74  0.3
 0.2     69  0.5
 0.1     62  0.1
 0   58  0.3
 0.2     54  0.6
 0.7     49  0.5
 0.7     40  0.5
 0.7     34  0.3
 0.8     34  1.1
 1.2     33  0.5
 1.6     33  1
 1.8     32  0.9
 2.1     32  0.8
 1.6     29  0.9
 1.8     26  0.9
 2.1     27  0.9
 2.4     27  1
 2.5     27  1
 2.7     27  0.8
 2.7     27  0.7
 3   29  0.6
 2.5     30  0.4
 2.9     32  0.1
 2.1     34  0.1
 2.2     36  0
 1.9     40  0
 1.5     43  0
 2.2     42  0.1
 1.3     45  -0.1
 1.6     50  -0.1
 2.4     55  0.1
 1.9     58  0.2
 1.8     59  0.1
 1.7     61  0.1
 1.9     63  0.1
 1.5     65  0.2
 1.8     66  0.2
 1.8     67  0.2
 1.6     69  0.1
 1.9     70  0.2
 2.2     72  0.2
 1.9     72  0.2
 1.9     73  0.1
 2.3     74  0.2
 2.1     73  0.3
 1.4     74  0.4
 1.7     72  0.9
 1.3     69  1.2
 0.3     64  0.8
 0.3     58  0.6
 0.1     53  0.5
 0.2     49  0.4
 0.3     46  0.4
 0.1     41  0.3
 0.5     35  0.3
 0.9     32  0.9
 1   30  0.6
 1.1     24  0.8
 1.1     23  0.7
 1.3     24  1
 1.2     23  1.3
 1.4     23  1.3
 1.2     22  1.2
 1.6     19  1
 1.7     19  1
 2.1     21  0.8
 2.2     21  0.9
 1.3     22  0.6
 1.1     23  0.5
 1.3     24  0.3
 1.2     28  0
 1.2     32  0
 0.3     35  0.1
 1   40  0
 1.6     44  0.1
 1.9     47  0.1
 1.5     49  0.1
 1.9     54  0.2
 1.5     55  0.2
 1.8     57  0.2
 2.1     59  0.2
 1.8     60  0.2
 1.5     62  0.2
 2.4     65  0.2
 2.1     66  0.2
 2.4     67  0.2
 2.4     68  0.3
 2.1     68  0.1
 1.5     70  0.3
 0.9     70  0.2
 1.2     71  0.2
 1.9     72  0.2
 2.7     72  0.3
 2.3     71  0.3
 0.9     70  0.5
 1   69  0.9
 0   63  0.4
 0.3     59  0.5
 0.1     53  0.3
 0.1     47  0.1
 0.6     43  0.3
 0.3     41  0.8
 0.6     37  0.5
 0.6     35  0.9
 0.6     30  0.4
 0.7     27  0.7
 1.1     24  0.7
 0.6     22  0.8
 1.3     18  0.6
 1.2     22  0.9
 1.7     24  0.9
 1.6     22  0.9
 1.5     21  0.7
 2   20  1
 0.6     20  0.7
 1.8     22  0.8
 1.7     25  0.5
 1.7     26  0.2
 1.6     30  0.1
 0.8     32  0.1
 0.2     34  0.2
 0.7     36  0.1
 0.8     38  0
 1.1     49  0.1
 0.8     52  0.2
 0.7     54  0.2
 1.7     56  0.1
 1.9     59  0.1
 2.5     61  0.2
 2.6     61  0.2
 2.5     63  0.2
 0.8     65  0.3
 0.3     63  0.3
 0.6     62  0.1
 1.7     65  0.1
 2.1     69  0.4
 2.1     70  0.3
 0.4     70  0.3
 1.4     69  0.1
 0.3     70  0.3
 1.8     70  0.2
 1.6     71  0.4
 1.1     71  0.5
 0.3     69  0.6
 0.3     64  0.4
 0.1     59  0.3
 0.7     57  0.4
 0.7     56  0.6
 0.5     53  0.8
 0.4     48  0.7
 0.2     43  0.6
 0.4     39  0.6
 0.6     35  0.9
 1.2     33  0.8
 4   22  1
 3.8     22  1.4
 3.3     19  1.5
 4.1     16  1.3
 4.3     17  1.2
 3.9     17  1.4
 4.1     25  0.6
 4.6     35  0.6
 3.8     39  0.6
 3   41  0.4
 1.7     45  0.4
 1.2     47  0.4
 1.2     49  0.2
 2.1     53  0.3
 2.3     56  0.2
 1.8     60  0.3
 0.9     62  0.3
 1.2     63  0.3
 0.9     64  0.2
 0.8     65  0.2
 2.1     67  0.3
 1.5     67  0.3
 0.4     67  0.3
 1   66  0.3
 0.1     62  0.3
 1.3     62  0.2
 2.4     70  0.3
 1.1     71  0.2
 2.4     75  0
 3   79  0.1
 3   78  0.2
 4.3     71  0.1
 3.9     67  0
 2.9     67  0
 1   72  0.2
 0.8     73  0.3
 2.7     73  0.3
 3.5     71  0.3
 3.1     70  0.4
 2.5     70  0.4
 1   68  0.5
 0.9     64  0.3
 1   64  0.4
 1.4     64  0.5
 1.2     66  0.4
 1.4     67  0.5
 0.1     65  0.9
 0.8     62  0.5
 0.7     55  0.9
 0.8     47  0.3
 0.8     47  0.7
 1.7     47  0.6
 2.9     47  0.7
 3.8     44  0.8
 2.5     41  1
 3.5     38  0.8
 3.4     34  0.6
 2.2     41  0.8
 2.3     45  0.6
 1.2     47  0.6
 1.8     42  0.2
 1.3     38  0.2
 2.3     40  0.2
 1.8     42  0.2
 1.5     44  0.3
 0.8     45  0.2
 1.1     48  0.2
 0.6     49  0.2
 0.6     51  0.2
 0   51  0.2
 0.3     54  0.2
 0.5     59  0.2
 0.5     62  0.2
 0.9     60  0.3
 1.2     58  0.3
 1   60  0.2
 0.2     63  0.3
 0.1     64  0.2
 0.8     64  0.2
 0.1     65  0.2
 0   65  0.2
 0.1     65  0.1
 0.5     68  0.2
 0.5     67  0.2
 1.1     68  0.4
 2   63  0.7
 2.9     54  0.4
 3.7     49  0.4
 4.4     45  0.5
 4.3     42  0.6
 3.8     38  0.6
 5.2     35  0.6
 4.9     34  0.5
 4.8     34  0.6
 4.9     33  0.7
 4.7     32  0.6
 5.3     32  0.4
 5.2     31  0.7
 5.2     30  0.7
 5   30  0.4
 5.4     30  0.6
 5.3     30  0.5
 5.4     32  0.3
 5.9     34  0.3
 5.7     33  0.3
 4.5     35  0.3
 4.6     37  0.4
 4.8     37  0.2
 4.5     39  0.2
 5   41  0.2
 4.1     43  0.2
 2.1     44  0.2
 1.8     45  0.1
 1.7     46  0.1
 1.2     47  0.2
 0.7     46  0.1
 2.2     44  0.1
 2.5     42  0.1
 2.4     42  0.2
 1.8     41  0.2
 1.4     41  0.1
 1.1     42  0
 2   46  -0.1
 1.2     50  0
 0.7     54  0
 1.6     57  0
 1.9     61  0.1
 1   62  0.1
 1.8     64  0.1
 2   65  0.1
 2.5     66  0.2
 2.4     66  0.5
 2.7     64  0.8
 1.9     58  0.9
 0.8     50  0.8
 1.2     40  0.3
 2.8     36  0.5
 3.5     34  0.4
 4.9     33  0.5
 3.9     32  0.5
 4   31  0.6
 3.7     30  0.6
 4.5     29  0.6
 4.3     29  0.7
 4   28  0.6
 4.2     27  0.7
 3.7     27  0.7
 3.9     27  0.6
 4.1     26  0.6
 4.7     27  0.7
 4.3     27  0.6
 4.9     27  0.5
 5.1     27  0.5
 4.9     28  0.3
 3.8     28  0.3
 4   30  0.2
 4   32  0.1
 4.4     35  0.1
 2.9     36  0.1
 2.6     38  0.1
 1.7     40  0.1
 2.4     41  0.2
 4.1     41  0.2
 2   43  -0.1
 1.2     49  0
 1.5     54  0.1
 1.4     57  0.2
 1.5     58  0.2
 0.5     59  0.1
 1   61  0
 2.3     64  0.3
 2.2     64  0.2
 1.8     65  0.2
 2.4     66  0.2
 1.8     66  0.1
 1.6     68  0.2
 2.7     69  0.2
 2.5     70  0.3
 2.5     70  0.2
 2.5     70  0.6
 2.1     70  0.9
 1.4     67  1.2
 1.4     63  1.2
 0.8     58  1
 1.2     53  1.2
 0.6     46  1
 0.2     39  0.6
 0.7     37  0.9
 1   35  0.9
 1   30  0.9
 1   25  0.7
 1.3     22  0.6
 1.9     20  0.7
 2.3     19  0.7
 2.2     18  0.7
 3.2     18  0.7
 2.8     17  0.6
 3.1     17  0.8
 3.3     17  0.6
 3.4     18  0.6
 3.1     18  0.5
 3.8     18  0.3
 2.9     19  0.3
 3.4     20  0.1
 3.7     23  0.1
 2.5     26  0.1
 0.8     28  0.1
 1.8     30  0.1
 2.2     31  0.1
 0.7     33  0
 0.9     38  0
 1.9     45  0.1
 2.2     48  0.3
 1.9     50  0.2
 2   52  0.1
 2.8     54  0.2
 2.9     55  0.3
 3.1     56  0.1
 2.7     58  0.3
 2.5     58  0.2
 2.7     60  0.2
 2.3     62  0.2
 1.8     63  0.2
 1.7     66  0.2
 1.2     65  0.2
 1.8     66  0.2
 2.1     68  0.4
 1.7     69  0.6
 1.5     66  1
 1.7     63  1.3
 1.1     59  1.4
 0.6     54  0.9
 0.6     47  0.6
 0.4     43  0.5
 0.4     36  0.2
 0.5     33  0.6
 0.6     31  0.6
 1.2     30  0.8
 1.3     29  0.6
 1.4     29  0.9
 1.6     29  0.9
 1.7     26  0.9
 3.1     22  1
 3.7     22  1.1
 3.5     22  1
 3.6     24  1.1
 3.3     23  1
 3.2     22  1.1
 3.7     22  0.8
 3.6     25  0.7
 3.3     28  0.7
 4   29  0.4
 3.1     32  0.2
 2   36  0.1
 1.4     38  0.2
 1.2     38  0.1
 0.3     37  0.2
 0.4     41  -0.1
 0.5     46  0.1
 0.6     49  0.1
 0.9     54  0.2
 0.7     56  0.1
 1   58  0.2
 1.9     62  0.3
 2   64  0.3
 2.5     65  0.4
 2.1     66  0.3
 1.1     67  0.2
 1.8     68  0.1
 2.3     71  0.3
 1.6     71  0.2
 2.1     73  0.3
 1.5     74  0.4
 2.1     75  0.2
 1.1     76  0.4
 1.9     75  0.8
 2   74  1.2
 1   70  1.5
 1.3     65  1.1
 1.7     62  1.2
 1.6     56  1.3
 0.6     51  0.9
 0.7     46  0.8
 1.2     39  0.8
 2.5     29  0.8
 2.1     28  0.9
 2.2     29  1.1
 1.9     31  0.9
 2   31  0.8
 1.7     32  0.7
 2.5     33  1.1
 3.9     31  1
 4.8     26  1.1
 6   26  0.9
 4.9     23  1
 4.8     23  0.9
 4.8     25  0.6
 4.2     26  0.5
 2.8     28  0.6
 2.6     29  0.5
 2.6     31  0.3
 2   33  0.3
 1.9     34  0.2
 2   37  0.1
 1.7     41  0.2
 0.9     41  0
 1.5     47  0.2
 1   50  0.1
 1.4     53  0.2
 1.6     54  0.2
 2   58  0.3
 1.6     59  0.3
 0.9     61  0.2
 0.3     62  0.3
 0.3     61  0.1
 1.1     64  0.2
 0.3     64  0.3
 0.2     63  0.2
 1.8     65  0.2
 1.1     66  0.3
 1.6     65  0.1
 2.1     65  0.2
 0.6     66  0.2
 1.5     65  0.3
 2.2     61  0
 3.2     60  0.5
 2.8     58  0.7
 3.4     56  0.7
 3.7     51  0.8
 4.8     47  0.7
 5.1     45  0.5
 4.9     44  0.5
 4.4     43  1
 4.9     40  0.7
 5.5     39  0.9
 5.7     37  0.9
 5.4     38  0.9
 5.6     38  0.8
 4.3     38  0.9
 4.8     38  1.1
 5.2     38  1.1
 4.5     38  1.2
 3.8     37  1.1
 2.9     38  1
 3   41  0.7
 2.7     42  0.7
 2.5     45  0.7
 2.3     47  0.5
 2.3     50  0.3
 2.1     53  0.4
 2.9     56  0.2
 2.1     58  0.4
 1.4     59  0.3
 1   60  0.3
 1.3     59  0.2
 3.9     54  0.1
 2.6     54  0.2
 2.3     54  0.1
 2.4     54  0.2
 2.8     54  0.1
 2.8     56  0.2
 2.8     56  0.2
 2.4     54  0.2
 2.2     55  0.2
 2.9     56  0.1
 4   56  0.2
 3.6     57  0.2
 1.1     55  0.2
 0.8     54  0.2
 1.4     53  0.2
 0.8     52  0.2
 1.5     52  0.1
 2.1     52  0.4
 3.2     50  0.5
 2.5     48  0.5
 1.5     44  0.5
 1.1     40  0.6
 0.7     37  0.6
 1.3     34  0.9
 1.3     30  1.2
 0.9     26  0.9
 1.4     21  1.3
 1.5     21  1.1
 3.2     21  0.3
 5.7     21  -0.4
 3.6     32  0.4
 2.1     30  0.4
 0.8     28  0.9
 0.7     24  0.9
 2.1     25  0.9
 2.8     27  1.6
 2   29  1.4
 2.1     29  1.2
 2.1     30  0.9
 2.5     31  0.5
 2   32  0.3
 1.3     37  0.3
 0.6     38  0.2
 1.2     38  0.1
 1.9     46  0.3
 1.8     45  0
 2.7     56  0.1
 1.8     61  -0.1
 0.5     64  0.2
 1.2     66  0.2
 1.2     70  0.2
 1.9     70  0.3
 2   68  0.2
 1.4     71  0.3
 0.7     72  0.2
 0.7     71  0.4
 0.5     69  0.2
 0.7     68  0.1
 0.1     70  0.1
 1   71  0
 0.1     71  0.1
 1.1     71  0.1
 1.4     75  0.2
 1.5     74  0.2
 2.2     75  0.9
 1   73  1.1
 0.1     65  0.8
 0.3     62  0.8
 0.5     61  0.4
 0.9     60  1
 1   52  1.1
 1.3     45  1.1
 1.3     41  1.4
 1.8     39  1.2
 1.1     34  1.2
 1.5     33  0.3
 4.5     40  -0.3
 2.3     55  -0.1
 2.9     62  0.2
 3.9     66  0.2
 4.1     64  0.2
 3.9     64  0.3
 2.9     63  0.2
 3.3     64  0.1
 4.4     62  0.1
 3.9     66  0.2
 2.5     67  0.2
 0.8     65  0.2
 1.1     64  0.2
 1.9     62  0.3
 2.4     57  0.2
 3   56  0.2
 2.3     56  0.2
 3.5     54  0.1
 4.3     63  0.1
 3.3     64  0.3
 1.5     62  0.3
 0.4     61  0.1
 1.1     62  0.2
 1.9     53  0.4
 3.8     46  0
 3.7     50  0.1
 2.2     54  0.2
 1   53  0.1
 1.1     52  0.1
 1.2     53  0.1
 2.7     53  0.1
 3.1     53  0.1
 1.4     54  0.1
 2.4     54  0
 2.4     54  0.1
 2.3     54  0.1
 1   54  0.4
 1.3     52  0.5
 1.9     50  0.5
 2.5     48  0.5
 1.4     44  0.5
 2.1     40  0.3
 3.4     38  0.6
 4.6     32  0.6
 3.5     30  0.4
 4.1     28  0.7
 2.8     29  0.6
 2.4     27  0.7
 2.6     24  0.8
 1.3     22  0.8
 1.4     22  0.7
 3   22  1
 2.6     22  1
 3.7     23  1.1
 4.1     23  1.1
 4.6     22  1.1
 4.9     21  0.9
 4.4     21  0.9
 4.5     23  0.8
 4.6     25  0.6
 4.4     24  0.4
 3.3     25  0.3
 2.4     27  0.1
 2.4     30  0.1
 1.4     35  0.1
 0.8     37  0.1
 2.4     40  0.2
 2.3     41  0.1
 1.2     44  0
 0.8     47  0.1
 1.2     50  0
 1.7     53  0.1
 2.2     56  0.1
 2   57  0.2
 2   59  0.4
 1.9     59  0.3
 2.3     60  0.3
 2.7     61  0.5
 2.6     60  0.4
 2.3     61  0.3
 1.7     62  0.3
 1.5     61  0.3
 2   62  0.4
 0.1     61  0.3
 0.7     62  0.2
 0.8     64  0.2
 1.1     65  0.4
 1.5     64  0.5
 2   55  0.5
 0.9     56  0.7
 1.8     59  0.9
 1.5     59  1.2
 1.1     57  1.2
 1.7     54  1.3
 0.7     50  0.9
 1   48  1.1
 1.2     43  1.5
 1   40  1
 3.2     46  -0.1
 4.4     42  0
 2.9     53  0.4
 1.4     55  0.8
 2.5     49  1
 5   48  0.7
 5.2     47  0.5
 1.7     42  0.8
 0.9     32  0.7
 5.6     41  -0.7
 6.5     61  -0.1
 5.8     64  0.1
 4.8     64  0.4
 2.9     62  0.1
 1.6     61  0.2
 1.8     58  0
 0.7     60  0.1
 1.6     59  0.2
 1.8     59  0.2
 1.3     60  0.2
 1.4     59  0.2
 0.2     58  0.1
 0.3     57  0.1
 1.3     59  0.1
 0.4     63  -0.1
 0   73  0.1
 0   73  0.3
 0.2     71  0
 0.1     73  0
 0.4     74  0.2
 0.2     75  0.2
 0.3     76  0.1
 0   75  0.1
 0.1     75  0.4
 0   70  0.5
 0   64  0.3
 0.4     66  0.7
 0.2     60  0.6
 0.7     56  0.8
 0.7     51  0.8
 0.2     42  0.5
 0.4     34  0.5
 1.3     32  1.1
 1.7     28  0.8
 1.8     23  0.6
 1.8     22  1.2
 2.4     22  1.6
 1.8     21  0.7
 3   24  0.4
 2.8     23  0.4
 2.8     24  0.6
 2.5     23  0.7
 3   24  0.1
 3.5     30  0.4
 3.5     32  0.3
 2.6     31  0.5
 1.4     28  0.5
 2   27  0.4
 2.7     30  0.3
 2.9     34  0
 5.1     43  0.1
 4.3     45  0.1
 3.6     46  0.2
 3.2     46  0.1
 3.1     46  0.2
 2.3     46  0.2
 2.5     46  0.1
 2.5     45  0.1
 3.7     44  0.2
 2.6     43  0.2
 1.5     44  0.2
 2   45  0.2
 2.3     46  0.2
 2.9     45  0.2
 2   44  0.2
 2.3     44  0.2
 2.8     38  0.1
 2.1     34  0.2
 3.7     34  0.1
 3.7     35  0.1
 4.2     36  0.3
 3   34  0.2
 2.4     37  0.1
 3.5     38  0.2
 3.2     42  0
 2.9     60  -0.2
 2   74  0.4
 3   71  0.5
 2.8     68  0.5
 3   69  0.3
 4.2     70  0.5
 4.2     62  0.9
 4.8     57  0.5
 3.3     63  0.4
 2.8     53  0.4
 2.9     53  0
 2   56  0.5
 1.8     56  0.5
 2.3     56  0.9
 2.7     49  0.9
 3.2     47  0.5
 1.4     50  0.3
 2.6     60  0
 1.9     70  0.1
 0.8     68  0.4
 1   65  0.2
 1.3     63  0.1
 2.7     62  0.2
 3.2     67  0
 2.6     79  0.1
 3.3     79  0.2
 3.2     77  0.2
 2.7     75  0.1
 2.1     74  0.1
 2.1     73  0.1
 1   72  0.1
 2.4     71  0.1
 1.7     68  0.1
 2.4     67  0.1
 1.9     68  0.1
 2.7     66  0.1
 2.2     67  0.2
 1.4     66  0.2
 1.7     65  0.1
 2.2     65  0.1
 1.2     67  0.2
 1.3     68  0.3
 1.5     65  0.1
 1.6     65  0.1
 1.2     66  0.1
 2   66  0.2
 2.6     67  0.1
 2.1     73  0
 3.1     76  0.2
 3.5     74  0.4
 2.9     68  0.3
 1.1     67  0.1
 1.6     71  0
 3.1     72  0.6
 2.7     69  0.3
 0.5     72  0.1
 1.7     74  0.5
 1.4     69  0.6
 1.1     65  0.7
 0.6     62  0.6
 0.7     56  0.6
 2.4     55  0.5
 1.8     56  0.6
 1   51  0.8
 0.7     48  0.7
 1.2     47  0.5
 2.3     49  0.4
 2.9     61  0
 0.6     64  0.9
 0.3     61  0.3
 0   60  0.4
 1.1     61  0.1
 1.7     66  0.2
 2.3     67  0.2
 0.7     68  0.2
 1.8     71  0.1
 0.8     77  0.1
 0.2     79  0.2
 0.2     79  0.2
 0.3     80  0.1
 0.3     81  0.3
 1.2     80  0.3
 0.3     80  0.1
 0.2     81  0.2
 0   81  0.2
 0   81  0.2
 0   81  0.1
 0   81  0.1
 0   81  0.2
 0.8     81  0.3
 0.3     79  0.3
 0.5     79  0.2
 0   79  0.2
 0.1     78  0.8
 1.3     75  1.2
 2   69  1.2
 1.1     66  0.9
 0.2     63  0.5
 0.6     61  0.6
 0.4     58  0.8
 0.4     54  0.7
 0.7     52  0.5
 0.7     52  0.8
 1.3     45  1.1
 1.2     42  1
 1.2     39  1
 1.2     35  1.1
 1.1     36  0.7
 1.7     33  1.1
 3.2     38  0.6
 2.8     40  0.6
 2.7     38  0.9
 2.2     36  1.1
 2.2     37  0.9
 2   40  0.6
 4.1     45  0.3
 3.5     49  0.3
 4.2     51  0.3
 2.7     55  0.4
 1.5     56  0.3
 1.6     58  0.3
 1.1     60  0
 2.7     68  0.2
 2.6     68  0.4
 1.9     66  0.2
 2.1     66  0.3
 2.3     67  0.3
 1.7     67  0.2
 1.8     68  0.1
 2.2     69  0.1
 2.6     70  0.1
 2   71  0.1
 0.1     71  0.1
 0.1     73  0.2
 0   72  0.2
 0.3     72  0.1
 0.5     73  0.1
 0.3     74  0
 1.7     76  0.1
 1.5     77  0.1
 2.1     79  0.4
 1.7     78  0.8
 1.6     76  1.1
 3.2     73  1
 3.2     69  0.9
 3.2     65  0.8
 2.8     61  1.1
 2.3     57  1.4
 2.1     53  1.3
 1.6     48  1.2
 1.6     42  0.8
 1.2     39  0.7
 0.9     35  0.7
 0.7     33  0.7
 1.4     33  0.6
 1.5     32  1.2
 1.6     32  1
 2   32  1
 1.9     30  0.8
 2.2     29  0.7
 2.9     32  0.7
 2.6     38  0.7
 2.4     38  0.7
 2   36  1.2
 1.9     38  1.1
 2.3     37  0.9
 1.9     38  0.5
 1.9     39  0.3
 1.6     43  0.2
 1.5     44  0.1
 1.3     47  0.1
 1.4     51  0
 1.2     58  0
 2   65  0.1
 2.3     66  0.2
 2.2     69  0.3
 2.5     70  0.2
 2.7     72  0.3
 2.9     73  0.2
 1.3     73  0.3
 1.5     74  0.3
 1.5     74  0.3
 1.1     75  0.2
 0.2     76  0.2
 0   76  0.2
 0.8     77  0.1
 1   77  0.2
 0.8     78  0.3
 0   77  0.4
 0   76  0.9
 0   75  0.9
 0   69  0.5
 0   62  0.5
 0.6     59  0.6
 0.5     55  0.3
 0.4     52  0.8
 0.7     46  0.5
 0.9     43  1
 2.1     43  1.2
 2.2     41  1.5
 2.7     48  1
 2.9     45  1
 2.1     43  1.2
 1.9     44  1.3
 2.3     42  1.2
 2   40  1.5
 1   34  0.9
 1.7     38  0.7
 1.9     41  0.6
 2   39  0.5
 3.2     47  0.5
 2.6     54  0.4
 1.4     62  0.6
 1.7     62  0.6
 1.5     65  0.4
 2.3     68  0.5
 1.2     67  0.3
 0.9     67  0.2
 1.1     66  0.2
 2   69  0.1
 2.5     73  0.2
 1.9     74  0.3
 1.8     75  0.3
 1.5     76  0.4
 1.4     77  0.3
 0.2     77  0.4
 0.5     76  0.2
 1.4     75  0.2
 1.1     76  0.3
 0.3     76  0.3
 1   76  0.2
 1.1     77  0.3
 0.7     77  0.2
 1.4     78  0.3
 1.7     80  0.3
 1.2     81  0.4
 0.9     80  0.3
 0.1     79  0.4
 1.3     77  0.3
 0.8     76  0.3
 1   77  0.4
 1.7     76  0.5
 1.8     77  0.4
 2.1     78  0.4
 2.1     79  0.4
 1.8     79  0.4
 1.1     77  0.4
 0.5     76  0.3
 0   74  0.3
 0.1     73  0.3
 1   74  0.2
 1.4     74  0.3
 1   73  0.2
 1   74  0.3
 0.8     71  0.4
 0.6     65  0.5
 0.8     65  0.6
 0.6     62  0.6
 1   61  0.9
 1.2     60  0.7
 1.1     61  1
 0.9     62  0.4
 1.1     64  0.1
 1.2     70  0
 0.4     71  0.1
 0.2     72  -0.1
 0.2     74  -0.1
 2   80  0.1
 2   81  0.1
 1.7     82  0.1
 1.2     82  0.1
 1.2     81  0
 1.8     83  0.1
 1.6     83  0.2
 1.4     83  0
 1.3     84  0.2
 1.2     83  0.1
 0.7     83  0.1
 1.5     83  0.1
 0.5     84  0.1
 0   83  0.1
 0.3     83  0
 0.1     82  0
 1.9     83  0
 0.8     84  0.2
 0   84  0.4
 0.1     83  0.5
 0.1     79  0.5
 0.1     73  0.6
 0.1     67  0.4
 0.9     62  1.1
 0.9     57  1.2
 0.5     47  0.4
 1.1     46  0.4
 0.6     42  0.3
 1   38  0.6
 1   34  0.7
 0.9     29  0.7
 1.1     26  0.9
 0.9     24  0.4
 1.6     24  1.2
 1.5     23  1.3
 1.7     24  1.2
 1.9     23  1.5
 1.1     22  1.2
 0.9     21  0.9
 0.9     21  1.1
 0.8     21  1
 1.4     21  0.8
 1.5     20  0.6
 1   24  0.3
 2.7     33  -0.2
 3.6     42  0
 2.6     45  0.1
 1.4     47  0.1
 2.7     48  0
 2.4     51  -0.2
 2.7     55  0.2
 1.9     58  0.2
 2.4     59  0.2
 2   63  0.2
 2.3     65  0.2
 2.2     68  0.1
 2.5     70  0.3
 2   71  0.3
 2   72  0.2
 2   71  0.1
 1.8     70  0
 1.5     69  -0.1
 1.6     70  0.1
 2.1     70  -0.1
 2.6     72  0.1
 2.9     73  0.3
 2.8     74  0.8
 2.6     70  1.2
 1.6     62  1.2
 2   58  1.1
 1.9     53  1.1
 2.5     48  1.3
 1.7     41  1.2
 1   39  1
 0.9     36  1.4
 1.1     33  1.3
 1.5     32  1.8
 1.4     31  1.3
 1.6     30  1.5
 1.5     28  0.9
 1.6     26  0.7
 1.5     26  0.9
 3.8     28  0.6
 4.3     29  0.4
 4.1     32  0.4
 4.2     33  0.5
 4.3     33  0.4
 4.7     33  0.5
 4.1     33  0.5
 4.2     33  0.3
 4.3     35  0.2
 4.2     38  0.1
 3.4     38  0.2
 2   38  0.2
 1.5     38  0.1
 2.3     37  0.1
 1.5     36  0.1
 1.9     36  0.1
 1.8     45  -0.1
 1.5     53  0.1
 2.2     56  0.1
 2.4     58  0.2
 2.5     58  0.1
 2.5     61  0.1
 2.4     63  0.1
 2.2     64  0.2
 2.4     64  0.2
 2.3     64  0.1
 1.6     66  0.2
 1.8     66  0.2
 1.3     67  0.2
 2.2     66  0.2
 2.2     68  0.1
 1.9     67  0.4
 1.8     66  0.6
 1.6     65  0.8
 1.7     63  1.3
 1.1     60  1.5
 0.3     53  0.7
 0.1     46  0.5
 0.8     39  0.7
 0.4     34  0.6
 0.6     30  0.7
 0.8     29  0.8
 1.1     26  1.2
 0.7     26  1.1
 0.7     23  0.4
 0.9     22  0.8
 1.6     23  1
 1.8     23  1.4
 2.1     21  0.9
 3.8     23  0.5
 3.8     24  0.7
 3.8     24  0.5
 4.6     25  0.5
 4.9     26  0.5
 4.2     27  0.4
 4.2     27  0.3
 4.9     28  0.2
 4.4     29  0.2
 1.8     31  0.1
 2.2     32  0.1
 2.2     33  0.3
 1   37  0.2
 2.3     37  0.2
 1.8     35  0.3
 0.5     34  0.1
 1.5     38  0.1
 -0.1    69  0.2
 -0.1    68  0.3
 -0.2    64  -0.2
 -0.2    71  0.1
 -0.2    72  0.2
 -0.1    70  0.3
 -0.1    63  -0.3
 -0.8    60  0.2
 -0.9    78  0.3
 -0.6    75  0.4
 -0.8    77  0.2
 -0.1    78  0.2
 -0.5    79  0.2
 -0.3    81  0.2
 -0.5    84  0.4
 -1  85  0.4
 -0.6    83  0.5
 -0.2    64  0
 -0.5    60  -0.1
 -0.3    63  0.3
 -0.7    59  0
 -0.1    61  -0.1
 -0.5    63  0
 -0.4    67  0.2
 -1  73  0.2
 -0.1    73  0.2
 -0.9    72  0.3
 -0.1    72  0.2
 -0.2    71  0.2
 -0.7    71  0.5
 -0.4    70  0.4
 -0.2    69  0.3
 -0.2    67  0.5
 -0.1    64  0.6
 -0.5    60  0.8
 -0.7    59  1
 -0.2    54  0.4
 -0.3    51  0.7
 -0.4    49  0.6
 -0.9    44  0.7
 -1  43  0.6
 -0.8    48  0.2
 -0.8    50  0.2
 -0.4    52  0.1
 -1  55  0.1
 -0.5    58  0.1
 -0.2    59  0
 -0.1    61  0.1
 -0.4    63  0
 -0.6    65  0.2
 -0.8    66  0
 -0.5    61  0.3
 -0.3    62  0.5
 -0.1    57  0.5
 -0.6    55  1.1
 -0.2    50  0.7
 -1  48  0.5
 -0.7    58  0
 -0.4    60  0
 -0.9    77  0.1
 -0.9    78  0.1
 -0.7    81  0.2
 -0.6    81  0.1
 -0.8    81  0.2
 -0.2    81  0.3
 -0.6    81  0.7
 -0.1    78  0.8
 -0.1    64  -0.1
 -0.1    62  0.1
 -0.2    58  0.4
 -0.2    49  0.4
 -0.4    42  0.3
 -0.6    39  0.6
 -1  36  0.6
 -0.5    70  0.1
 -0.8    71  0
 -0.9    76  0.2
 -1  77  0.2
 -0.6    81  0.1
 -0.9    80  0
 -1  81  0.5
 -0.5    80  0.8
 -0.2    69  0.5
 -0.1    62  0.1
 -0.2    54  0.6
 -0.7    49  0.5
 -0.7    40  0.5
 -0.7    34  0.3
 -0.8    34  1.1
 -0.3    64  0.8
 -0.3    58  0.6
 -0.1    53  0.5
 -0.2    49  0.4
 -0.3    46  0.4
 -0.1    41  0.3
 -0.5    35  0.3
 -0.9    32  0.9
 -1  30  0.6
 -0.3    35  0.1
 -1  40  0
 -0.9    70  0.2
 -0.9    70  0.5
 -1  69  0.9
 -0.3    59  0.5
 -0.1    53  0.3
 -0.1    47  0.1
 -0.6    43  0.3
 -0.3    41  0.8
 -0.6    37  0.5
 -0.6    35  0.9
 -0.6    30  0.4
 -0.7    27  0.7
 -0.6    22  0.8
 -0.6    20  0.7
 -0.8    32  0.1
 -0.2    34  0.2
 -0.7    36  0.1
 -0.8    38  0
 -0.8    52  0.2
 -0.7    54  0.2
 -0.8    65  0.3
 -0.3    63  0.3
 -0.6    62  0.1
 -0.4    70  0.3
 -0.3    70  0.3
 -0.3    69  0.6
 -0.3    64  0.4
 -0.1    59  0.3
 -0.7    57  0.4
 -0.7    56  0.6
 -0.5    53  0.8
 -0.4    48  0.7
 -0.2    43  0.6
 -0.4    39  0.6
 -0.6    35  0.9
 -0.9    62  0.3
 -0.9    64  0.2
 -0.8    65  0.2
 -0.4    67  0.3
 -1  66  0.3
 -0.1    62  0.3
 -1  72  0.2
 -0.8    73  0.3
 -1  68  0.5
 -0.9    64  0.3
 -1  64  0.4
 -0.1    65  0.9
 -0.8    62  0.5
 -0.7    55  0.9
 -0.8    47  0.3
 -0.8    47  0.7
 -0.8    45  0.2
 -0.6    49  0.2
 -0.6    51  0.2
 -0.3    54  0.2
 -0.5    59  0.2
 -0.5    62  0.2
 -0.9    60  0.3
 -1  60  0.2
 -0.2    63  0.3
 -0.1    64  0.2
 -0.8    64  0.2
 -0.1    65  0.2
 -0.1    65  0.1
 -0.5    68  0.2
 -0.5    67  0.2
 -0.7    46  0.1
 -0.7    54  0
 -1  62  0.1
 -0.8    50  0.8
 -0.5    59  0.1
 -1  61  0
 -0.8    58  1
 -0.6    46  1
 -0.2    39  0.6
 -0.7    37  0.9
 -1  35  0.9
 -1  30  0.9
 -1  25  0.7
 -0.8    28  0.1
 -0.7    33  0
 -0.9    38  0
 -0.6    54  0.9
 -0.6    47  0.6
 -0.4    43  0.5
 -0.4    36  0.2
 -0.5    33  0.6
 -0.6    31  0.6
 -0.3    37  0.2
 -0.4    41  -0.1
 -0.5    46  0.1
 -0.6    49  0.1
 -0.9    54  0.2
 -0.7    56  0.1
 -1  58  0.2
 -1  70  1.5
 -0.6    51  0.9
 -0.7    46  0.8
 -0.9    41  0
 -1  50  0.1
 -0.9    61  0.2
 -0.3    62  0.3
 -0.3    61  0.1
 -0.3    64  0.3
 -0.2    63  0.2
 -0.6    66  0.2
 -1  60  0.3
 -0.8    54  0.2
 -0.8    52  0.2
 -0.7    37  0.6
 -0.9    26  0.9
 -0.8    28  0.9
 -0.7    24  0.9
 -0.6    38  0.2
 -0.5    64  0.2
 -0.7    72  0.2
 -0.7    71  0.4
 -0.5    69  0.2
 -0.7    68  0.1
 -0.1    70  0.1
 -1  71  0
 -0.1    71  0.1
 -1  73  1.1
 -0.1    65  0.8
 -0.3    62  0.8
 -0.5    61  0.4
 -0.9    60  1
 -1  52  1.1
 -0.8    65  0.2
 -0.4    61  0.1
 -1  53  0.1
 -1  54  0.4
 -0.8    37  0.1
 -0.8    47  0.1
 -0.1    61  0.3
 -0.7    62  0.2
 -0.8    64  0.2
 -0.9    56  0.7
 -0.7    50  0.9
 -1  48  1.1
 -1  40  1
 -0.9    32  0.7
 -0.7    60  0.1
 -0.2    58  0.1
 -0.3    57  0.1
 -0.4    63  -0.1
 -0.2    71  0
 -0.1    73  0
 -0.4    74  0.2
 -0.2    75  0.2
 -0.3    76  0.1
 -0.1    75  0.4
 -0.4    66  0.7
 -0.2    60  0.6
 -0.7    56  0.8
 -0.7    51  0.8
 -0.2    42  0.5
 -0.4    34  0.5
 -0.8    68  0.4
 -1  65  0.2
 -1  72  0.1
 -0.5    72  0.1
 -0.6    62  0.6
 -0.7    56  0.6
 -1  51  0.8
 -0.7    48  0.7
 -0.6    64  0.9
 -0.3    61  0.3
 -0.7    68  0.2
 -0.8    77  0.1
 -0.2    79  0.2
 -0.2    79  0.2
 -0.3    80  0.1
 -0.3    81  0.3
 -0.3    80  0.1
 -0.2    81  0.2
 -0.8    81  0.3
 -0.3    79  0.3
 -0.5    79  0.2
 -0.1    78  0.8
 -0.2    63  0.5
 -0.6    61  0.6
 -0.4    58  0.8
 -0.4    54  0.7
 -0.7    52  0.5
 -0.7    52  0.8
 -0.1    71  0.1
 -0.1    73  0.2
 -0.3    72  0.1
 -0.5    73  0.1
 -0.3    74  0
 -0.9    35  0.7
 -0.7    33  0.7
 -0.2    76  0.2
 -0.8    77  0.1
 -1  77  0.2
 -0.8    78  0.3
 -0.6    59  0.6
 -0.5    55  0.3
 -0.4    52  0.8
 -0.7    46  0.5
 -0.9    43  1
 -1  34  0.9
 -0.9    67  0.2
 -0.2    77  0.4
 -0.5    76  0.2
 -0.3    76  0.3
 -1  76  0.2
 -0.7    77  0.2
 -0.9    80  0.3
 -0.1    79  0.4
 -0.8    76  0.3
 -1  77  0.4
 -0.5    76  0.3
 -0.1    73  0.3
 -1  74  0.2
 -1  73  0.2
 -1  74  0.3
 -0.8    71  0.4
 -0.6    65  0.5
 -0.8    65  0.6
 -0.6    62  0.6
 -1  61  0.9
 -0.9    62  0.4
 -0.4    71  0.1
 -0.2    72  -0.1
 -0.2    74  -0.1
 -0.7    83  0.1
 -0.5    84  0.1
 -0.3    83  0
 -0.1    82  0
 -0.8    84  0.2
 -0.1    83  0.5
 -0.1    79  0.5
 -0.1    73  0.6
 -0.1    67  0.4
 -0.9    62  1.1
 -0.9    57  1.2
 -0.5    47  0.4
 -0.6    42  0.3
 -1  38  0.6
 -1  34  0.7
 -0.9    29  0.7
 -0.9    24  0.4
 -0.9    21  0.9
 -0.9    21  1.1
 -0.8    21  1
 -1  24  0.3
 -1  39  1
 -0.9    36  1.4
 -0.3    53  0.7
 -0.1    46  0.5
 -0.8    39  0.7
 -0.4    34  0.6
 -0.6    30  0.7
 -0.8    29  0.8
 -0.7    26  1.1
 -0.7    23  0.4
 -0.9    22  0.8
 -1  37  0.2
 -0.5    34  0.1

And the script,

import matplotlib.tri as mtri
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
with open('../gnuplot/bin/datos.txt', 'r') as f:
    lines = f.readlines()
    x = [float(line.split()[0]) for line in lines]
    y = [float(line.split()[1]) for line in lines]
    z = [float(line.split()[2]) for line in lines]

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

ax.scatter(x, y, marker=".", c="#DC143C", edgecolors="black", s=100)
ax.set_xlabel('X')
ax.set_ylabel('Y')

triang = mtri.Triangulation(x, y)

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

ax.triplot(triang, c="#D3D3D3", marker='.', markerfacecolor="#DC143C",
    markeredgecolor="black", markersize=10)

ax.set_xlabel('X')
ax.set_ylabel('Y')

isBad = np.where((x<-1) | (x>7) | (y<12) | (y>88), True, False)

mask = np.any(isBad[triang.triangles],axis=1)
triang.set_mask(mask)

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

ax.triplot(triang, c="#D3D3D3", marker='.', markerfacecolor="#DC143C", 
    markeredgecolor="black", markersize=10)

ax.set_xlabel('X')
ax.set_ylabel('Y')

fig = plt.figure()
ax = fig.add_subplot(1,1,1, projection='3d')

ax.plot_trisurf(triang, z, cmap='jet')
ax.scatter(x,y,z, marker='.', s=10, c="black", alpha=0.5)
ax.view_init(elev=60, azim=-45)

ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
plt.show()

The error messages refers to the definition of IsBad,

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'list' and 'int'

LEAVE A COMMENT