我正在编写一些代码,希望在其中进行绘图。 为此,我使用了matplotlib(v 2.2.3)的tricontourf函数,因为数据是非结构化的。我要绘制的每个数组都包含1000个float32值。
在某些情况下,一切正常,情节按预期出炉。但是,对于其中的某些数组,我会收到以下错误消息:
TypeError:最后的轮廓线必须给出级别;查看帮助(contourf) 异常RuntimeError:RuntimeError(“无法加入当前线程”,)被忽略
仅当我将轮廓级别指定为整数时才会出现错误。如果我改为将“ levels” arg指定为具有相同数量级别的np.linspace,则不会有问题。 但是由于我不知道为什么错误会首先出现(因为在某些情况下它会起作用),因此我有点犹豫,只是用那个替换参数。
希望有人对此有经验并能回答我的问题。
程序中对应的代码行是:
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 22})
x = [0.001,0.002,0.003,0.004,0.004,0.005,0.007,0.007,0.008,0.008,0.008,0.009,0.009,0.009,0.009,0.011,0.012,0.013,0.014,0.014,0.015,0.015,0.015,0.019,0.019,0.020,0.020,0.024,0.024,0.025,0.026,0.027,0.028,0.030,0.032,0.034,0.036,0.039,0.040,0.041,0.041,0.042,0.044,0.045,0.046,0.046,0.047,0.049,0.050,0.051,0.051,0.052,0.052,0.055,0.058,0.060,0.062,0.064,0.064,0.065,0.065,0.065,0.066,0.067,0.068,0.068,0.069,0.070,0.070,0.073,0.075,0.076,0.076,0.076,0.076,0.077,0.080,0.082,0.083,0.084,0.084,0.087,0.089,0.090,0.090,0.091,0.092,0.092,0.092,0.093,0.093,0.093,0.095,0.095,0.096,0.096,0.096,0.097,0.097,0.097,0.098,0.098,0.098,0.098,0.099,0.099,0.102,0.104,0.104,0.104,0.105,0.105,0.105,0.109,0.110,0.111,0.113,0.115,0.115,0.116,0.118,0.121,0.121,0.122,0.124,0.124,0.125,0.125,0.126,0.127,0.127,0.128,0.128,0.130,0.131,0.132,0.132,0.132,0.133,0.134,0.135,0.137,0.138,0.138,0.140,0.140,0.140,0.141,0.142,0.146,0.146,0.148,0.150,0.150,0.151,0.152,0.154,0.156,0.157,0.158,0.158,0.158,0.158,0.158,0.159,0.159,0.161,0.161,0.162,0.164,0.167,0.169,0.170,0.171,0.173,0.173,0.173,0.173,0.173,0.176,0.177,0.178,0.179,0.179,0.180,0.181,0.182,0.183,0.184,0.184,0.185,0.186,0.186,0.193,0.194,0.195,0.195,0.195,0.196,0.196,0.197,0.199,0.200,0.201,0.201,0.201,0.202,0.203,0.203,0.204,0.205,0.205,0.206,0.206,0.212,0.214,0.217,0.218,0.221,0.222,0.222,0.223,0.224,0.227,0.227,0.228,0.228,0.228,0.232,0.233,0.234,0.234,0.234,0.236,0.237,0.237,0.237,0.237,0.239,0.242,0.242,0.243,0.243,0.244,0.246,0.246,0.247,0.247,0.247,0.248,0.248,0.249,0.250,0.252,0.253,0.256,0.256,0.256,0.258,0.258,0.261,0.266,0.269,0.270,0.271,0.271,0.271,0.272,0.272,0.275,0.275,0.277,0.278,0.280,0.283,0.283,0.284,0.284,0.286,0.287,0.289,0.289,0.290,0.292,0.295,0.295,0.297,0.299,0.301,0.302,0.303,0.304,0.304,0.305,0.305,0.305,0.306,0.306,0.307,0.308,0.310,0.311,0.312,0.312,0.313,0.313,0.314,0.314,0.314,0.316,0.317,0.318,0.318,0.319,0.319,0.319,0.321,0.322,0.322,0.322,0.323,0.324,0.325,0.325,0.326,0.326,0.328,0.328,0.330,0.333,0.336,0.336,0.337,0.338,0.338,0.339,0.340,0.340,0.341,0.342,0.345,0.345,0.348,0.349,0.350,0.351,0.351,0.352,0.352,0.353,0.354,0.356,0.357,0.359,0.360,0.361,0.362,0.363,0.363,0.363,0.363,0.364,0.365,0.365,0.366,0.366,0.367,0.367,0.368,0.369,0.370,0.374,0.374,0.375,0.376,0.377,0.377,0.378,0.379,0.380,0.381,0.382,0.382,0.384,0.385,0.385,0.386,0.386,0.386,0.387,0.387,0.387,0.388,0.388,0.389,0.390,0.391,0.393,0.393,0.394,0.395,0.396,0.397,0.398,0.398,0.398,0.398,0.399,0.400,0.402,0.402,0.404,0.405,0.405,0.407,0.407,0.407,0.407,0.407,0.408,0.408,0.409,0.410,0.411,0.412,0.412,0.413,0.413,0.414,0.414,0.414,0.415,0.415,0.416,0.417,0.417,0.418,0.418,0.418,0.418,0.418,0.422,0.422,0.424,0.424,0.427,0.427,0.430,0.431,0.431,0.432,0.433,0.433,0.433,0.434,0.436,0.437,0.439,0.440,0.440,0.440,0.442,0.446,0.446,0.448,0.450,0.452,0.453,0.456,0.456,0.456,0.457,0.458,0.459,0.459,0.460,0.460,0.461,0.461,0.462,0.462,0.463,0.463,0.464,0.465,0.465,0.466,0.466,0.470,0.470,0.473,0.474,0.477,0.479,0.480,0.481,0.482,0.482,0.483,0.483,0.484,0.485,0.487,0.487,0.487,0.487,0.488,0.488,0.492,0.492,0.493,0.495,0.496,0.497,0.498,0.499,0.501,0.503,0.504,0.504,0.504,0.506,0.507,0.510,0.511,0.511,0.512,0.512,0.513,0.513,0.514,0.515,0.516,0.516,0.517,0.517,0.518,0.520,0.520,0.521,0.523,0.525,0.525,0.529,0.529,0.530,0.532,0.532,0.532,0.533,0.534,0.534,0.535,0.535,0.536,0.536,0.538,0.539,0.540,0.540,0.540,0.540,0.542,0.544,0.544,0.544,0.545,0.547,0.547,0.547,0.547,0.549,0.549,0.550,0.550,0.550,0.553,0.554,0.555,0.557,0.557,0.558,0.559,0.562,0.562,0.563,0.563,0.565,0.567,0.567,0.567,0.568,0.569,0.570,0.570,0.570,0.572,0.572,0.573,0.575,0.575,0.577,0.578,0.579,0.579,0.582,0.583,0.584,0.584,0.585,0.586,0.586,0.586,0.586,0.587,0.587,0.590,0.592,0.596,0.596,0.596,0.597,0.597,0.598,0.603,0.606,0.607,0.610,0.611,0.612,0.612,0.612,0.614,0.614,0.614,0.614,0.615,0.615,0.615,0.617,0.619,0.620,0.620,0.623,0.623,0.624,0.624,0.625,0.626,0.626,0.629,0.629,0.629,0.631,0.631,0.633,0.638,0.639,0.639,0.640,0.640,0.641,0.641,0.642,0.643,0.644,0.644,0.644,0.645,0.645,0.645,0.646,0.648,0.652,0.652,0.653,0.654,0.657,0.657,0.658,0.658,0.658,0.659,0.659,0.659,0.659,0.662,0.664,0.665,0.665,0.665,0.666,0.668,0.668,0.669,0.670,0.670,0.671,0.671,0.672,0.674,0.676,0.677,0.677,0.678,0.680,0.680,0.683,0.683,0.683,0.686,0.686,0.687,0.687,0.687,0.688,0.688,0.689,0.690,0.692,0.692,0.692,0.693,0.693,0.694,0.694,0.695,0.695,0.696,0.696,0.697,0.699,0.699,0.700,0.700,0.700,0.701,0.701,0.702,0.703,0.703,0.704,0.705,0.706,0.708,0.710,0.711,0.711,0.712,0.712,0.713,0.713,0.713,0.715,0.716,0.718,0.718,0.718,0.718,0.718,0.718,0.720,0.721,0.721,0.723,0.724,0.724,0.726,0.728,0.729,0.729,0.734,0.735,0.736,0.740,0.740,0.741,0.741,0.742,0.742,0.742,0.742,0.743,0.746,0.747,0.748,0.748,0.750,0.750,0.753,0.755,0.755,0.755,0.758,0.760,0.760,0.763,0.763,0.764,0.767,0.768,0.770,0.776,0.781,0.781,0.783,0.785,0.786,0.786,0.786,0.789,0.790,0.790,0.793,0.794,0.795,0.796,0.797,0.799,0.799,0.800,0.801,0.802,0.802,0.803,0.805,0.807,0.809,0.809,0.811,0.812,0.814,0.815,0.816,0.817,0.817,0.817,0.818,0.819,0.820,0.822,0.822,0.824,0.827,0.831,0.831,0.833,0.837,0.837,0.839,0.839,0.841,0.841,0.844,0.844,0.847,0.848,0.848,0.848,0.850,0.850,0.851,0.853,0.853,0.855,0.855,0.855,0.856,0.859,0.859,0.860,0.862,0.862,0.863,0.866,0.869,0.872,0.872,0.874,0.874,0.876,0.877,0.884,0.884,0.885,0.886,0.889,0.889,0.890,0.890,0.891,0.891,0.892,0.893,0.894,0.895,0.895,0.895,0.898,0.900,0.901,0.901,0.903,0.903,0.903,0.906,0.906,0.907,0.908,0.912,0.912,0.913,0.914,0.914,0.914,0.915,0.916,0.916,0.920,0.921,0.923,0.924,0.924,0.925,0.926,0.926,0.926,0.929,0.929,0.929,0.930,0.931,0.931,0.932,0.932,0.933,0.935,0.937,0.939,0.942,0.943,0.944,0.945,0.946,0.946,0.947,0.947,0.947,0.947,0.947,0.948,0.948,0.951,0.951,0.951,0.951,0.952,0.954,0.954,0.957,0.961,0.962,0.963,0.963,0.964,0.964,0.965,0.967,0.968,0.971,0.973,0.974,0.975,0.975,0.976,0.977,0.978,0.978,0.979,0.979,0.980,0.980,0.982,0.982,0.983,0.983,0.984,0.986,0.988,0.989,0.989,0.989,0.990,0.990,0.995,0.997,0.998,0.998,1.000,1.000]
y = [0.866,0.856,0.047,0.330,0.768,0.381,0.669,0.191,0.422,0.829,0.439,0.638,0.436,0.375,0.532,0.567,0.486,0.469,0.875,0.258,0.917,0.112,0.107,0.852,0.228,0.212,0.068,0.373,0.813,0.875,0.571,0.510,0.518,0.885,0.295,0.878,0.246,0.280,0.034,0.264,0.504,0.331,0.783,0.805,0.431,0.528,0.501,0.591,0.661,0.831,0.640,0.239,0.363,0.325,0.792,0.293,0.168,0.014,0.879,0.188,0.748,0.694,0.597,0.583,0.036,0.508,0.888,0.020,0.036,0.274,0.846,0.449,0.975,0.737,0.223,0.337,0.761,0.671,0.762,0.462,0.748,0.560,0.689,0.687,0.433,0.041,0.392,0.709,0.867,0.010,0.824,0.482,0.957,0.139,0.169,0.894,0.336,0.281,0.462,0.836,0.263,0.828,0.664,0.497,0.832,0.590,0.004,0.900,0.030,0.640,0.504,0.257,0.473,0.961,0.407,0.926,0.185,0.388,0.102,0.998,0.786,0.773,0.748,0.262,0.086,0.414,0.082,0.183,0.898,0.532,0.652,0.147,0.593,0.099,0.521,0.211,0.604,0.291,0.018,0.688,0.196,0.657,0.610,0.787,0.460,0.633,0.985,0.823,0.052,0.559,0.216,0.704,0.405,0.186,0.818,0.098,0.310,0.545,0.518,0.376,0.830,0.903,0.091,0.616,0.424,0.272,0.214,0.549,0.827,0.275,0.975,0.162,0.557,0.474,0.099,0.482,0.328,0.371,0.277,0.648,0.149,0.808,0.724,0.510,0.471,0.533,0.830,0.909,0.246,0.843,0.397,0.542,0.198,0.743,0.669,0.418,0.264,0.943,0.822,0.094,0.704,0.437,0.785,0.216,0.303,0.955,0.892,0.286,0.676,0.580,0.726,0.352,0.393,0.806,0.370,0.511,0.197,0.721,0.102,0.909,0.414,0.940,0.142,0.573,0.134,0.537,0.706,0.319,0.305,0.545,0.938,0.274,0.053,0.147,0.284,0.523,0.305,0.407,0.594,0.952,0.486,0.972,0.251,0.635,0.405,0.213,0.651,0.843,0.610,0.175,0.553,0.841,0.237,0.340,0.823,0.746,0.892,0.217,0.628,0.937,0.885,0.019,0.724,0.088,0.987,0.391,0.208,0.231,0.791,0.133,0.462,0.479,0.536,0.431,0.324,0.773,0.904,0.724,0.924,0.946,0.655,0.355,0.364,0.847,0.272,0.767,0.274,0.510,0.523,0.965,0.853,0.085,0.361,0.196,0.537,0.887,0.963,0.186,0.390,0.476,0.590,0.950,0.760,0.779,0.499,0.861,0.317,0.475,0.094,0.192,0.490,0.575,0.347,0.705,0.604,0.469,0.386,0.057,0.577,0.226,0.883,0.276,0.425,0.998,0.503,0.719,0.659,0.420,0.741,0.725,0.406,0.044,0.558,0.886,0.137,0.837,0.945,0.319,0.337,0.788,0.537,0.433,0.094,0.330,0.544,0.214,0.568,0.558,0.362,0.049,0.484,0.912,0.717,0.727,0.460,0.834,0.982,0.823,0.007,0.509,0.967,0.240,0.889,0.818,0.624,0.650,0.724,0.367,0.074,0.017,0.994,0.175,0.798,0.169,0.686,0.950,0.251,0.214,0.129,0.263,0.567,0.446,0.928,0.880,0.539,0.188,0.718,0.290,0.445,0.335,0.732,0.122,0.298,0.340,0.503,0.431,0.672,0.742,0.086,0.742,0.608,0.135,0.391,0.326,0.901,0.306,0.197,0.282,0.476,0.481,0.125,0.780,0.361,0.735,0.280,0.712,0.697,0.637,0.589,0.286,0.814,0.908,0.661,0.995,0.624,0.041,0.959,0.954,0.473,0.207,0.267,0.269,0.986,0.023,0.729,0.929,0.618,0.662,0.142,0.601,0.581,0.946,0.853,0.826,0.912,0.493,0.844,0.370,0.745,0.237,0.042,0.663,0.878,0.837,0.970,0.703,0.585,0.225,0.076,0.534,0.149,0.922,0.561,0.874,0.463,0.935,0.883,0.335,0.473,0.534,0.533,0.046,0.947,0.647,0.632,0.830,0.568,0.090,0.463,0.140,0.701,0.704,0.474,0.249,0.403,0.488,0.163,0.437,0.424,0.719,0.394,0.959,0.284,0.935,0.429,0.169,0.579,0.227,0.406,0.721,0.203,0.838,0.231,0.307,0.942,0.151,0.500,0.436,0.405,0.408,0.595,0.207,0.366,0.537,0.421,0.527,0.468,0.233,0.159,0.310,0.247,0.900,0.915,0.545,0.547,0.315,0.584,0.205,0.071,0.961,0.252,0.173,0.303,0.487,0.010,0.142,0.025,0.347,0.224,0.779,0.359,0.437,0.609,0.645,0.568,0.684,0.668,0.933,0.604,0.914,0.542,0.449,0.172,0.282,0.918,0.568,0.715,0.836,0.187,0.922,0.613,0.801,0.605,0.456,0.776,0.609,0.209,0.261,0.297,0.520,0.136,0.914,0.721,0.364,0.957,0.508,0.683,0.127,0.985,0.970,0.953,0.442,0.363,0.505,0.039,0.362,0.739,0.482,0.764,0.890,0.193,0.685,0.128,0.129,0.952,0.538,0.214,0.806,0.847,0.055,0.200,0.710,0.370,0.691,0.710,0.117,0.849,0.271,0.388,0.648,0.269,0.898,0.170,0.854,0.280,0.906,0.995,0.339,0.830,0.467,0.950,0.946,0.323,0.862,0.945,0.830,0.577,0.443,0.454,0.475,0.939,0.399,0.133,0.391,0.563,0.304,0.536,0.109,0.788,0.452,0.850,0.334,0.569,0.790,0.560,0.381,0.568,0.477,0.862,0.224,0.946,0.902,0.800,0.895,0.494,0.221,0.871,0.480,0.384,0.294,0.299,0.922,0.106,0.090,0.470,0.388,0.738,0.256,0.304,0.437,0.802,0.257,0.318,0.225,0.003,0.892,0.811,0.299,0.397,0.292,0.491,0.626,0.541,0.302,0.562,0.226,0.825,0.211,0.058,0.442,0.564,0.700,0.074,0.744,0.292,0.916,0.176,0.845,0.209,0.900,0.643,0.426,0.952,0.914,0.346,0.846,0.718,0.653,0.732,0.795,0.978,0.447,0.849,0.294,0.380,0.546,0.335,0.029,0.732,0.335,0.797,0.336,0.743,0.703,0.921,0.127,0.631,0.896,0.688,0.728,0.575,0.222,0.192,0.750,0.618,0.064,0.429,0.310,0.508,0.165,0.986,0.510,0.529,0.592,0.088,0.536,0.745,0.551,0.543,0.792,0.972,0.068,0.190,0.321,0.309,0.884,0.237,0.967,0.166,0.985,0.712,0.651,0.169,0.918,0.609,0.690,0.226,0.057,0.964,0.970,0.981,0.193,0.319,0.841,0.549,0.662,0.453,0.358,0.633,0.119,0.906,0.157,0.776,0.606,0.684,0.861,0.990,0.799,0.129,0.094,0.918,0.110,0.729,0.200,0.525,0.076,0.022,0.285,0.754,0.913,0.494,0.396,0.737,0.724,0.499,0.119,0.486,0.527,0.851,0.239,0.600,0.470,0.977,0.131,0.756,0.754,0.327,0.870,0.822,0.917,0.001,0.657,0.345,0.335,0.837,0.799,0.163,0.884,0.496,0.781,0.836,0.174,0.855,0.420,0.019,0.697,0.721,0.594,0.277,0.088,0.686,0.984,0.670,0.288,0.213,0.270,0.750,0.832,0.756,0.309,0.286,0.261,0.482,0.657,0.907,0.705,0.975,0.670,0.113,0.694,0.957,0.977,0.075,0.470,0.246,0.474,0.443,0.243,0.846,0.076,0.521,0.456,0.320,0.267,0.478,0.515,0.510,0.667,0.812,0.320,0.604,0.229,0.862,0.404,0.404,0.520,0.430,0.808,0.025,0.160,0.849,0.521,0.465,0.931,0.187,0.190,0.886,0.167,0.854,0.831,0.792,0.874,0.837,0.029,0.152,0.570,0.334,0.493,0.634,0.100,0.764,0.488,0.421,0.962,0.394,0.982,0.125,0.722,0.728,0.268,0.044,0.558,0.590,0.190,0.863,0.997,0.159,0.350,0.363,0.812,0.539,0.501,0.692,0.570,0.492,0.033,0.930,0.876,0.316,0.882,0.824,0.353,0.132,0.069,0.818,0.348,0.639,0.944,0.511,0.645,0.854,0.525,0.271,0.832,0.808,0.111,0.663,0.362,0.177,0.027,0.826,0.743,0.762,0.337,0.111,0.807,0.824,0.009,0.583,0.554,0.610,0.159,0.491,0.860,0.367,0.559,0.216,0.693,0.375,0.313,0.219,0.396,0.420,0.531,0.399,0.348,0.466,0.793,0.767,0.353,0.390,0.500,0.047,0.870,0.815,0.869,0.716,0.032,0.542,0.482]
z1 = [0.609,0.559,0.616,0.660,0.703,0.641,0.606,0.681,0.735,0.720,0.444,0.829,0.776,0.679,0.709,0.752,0.756,0.711,0.837,0.508,0.791,0.790,0.789,0.773,0.765,0.847,0.656,0.798,0.875,0.866,0.552,0.854,0.818,0.653,0.908,0.739,0.872,0.558,0.853,0.912,0.981,0.650,1.009,0.952,0.997,0.685,0.943,0.664,0.961,0.855,0.983,0.981,0.867,1.049,1.025,0.704,0.947,1.023,0.947,1.023,0.962,0.986,1.028,1.023,0.869,1.107,0.851,1.026,0.940,1.005,1.063,1.008,1.127,0.788,1.068,1.069,1.038,0.669,1.084,1.073,1.096,1.121,1.078,1.113,0.961,1.104,0.913,1.125,1.107,0.755,1.124,1.110,1.168,1.117,0.569,1.097,1.132,1.012,1.009,1.105,0.647,1.188,0.711,0.939,1.137,1.113,1.026,1.112,0.939,1.318,1.221,1.133,1.132,1.217,1.138,0.770,1.193,1.188,1.037,0.605,0.926,1.178,1.154,1.106,1.182,1.212,1.127,1.239,1.225,1.226,1.269,1.312,1.120,1.321,1.294,1.253,1.232,1.213,1.224,1.146,1.200,0.983,1.079,1.150,1.128,1.110,1.250,1.334,1.162,1.217,1.254,1.341,1.190,1.220,1.260,1.213,1.302,1.258,1.167,1.225,1.158,1.217,1.020,1.189,1.118,1.044,1.139,1.167,1.260,1.056,1.216,1.171,1.076,1.210,1.076,1.001,0.826,1.205,1.296,1.149,1.097,1.185,1.201,1.307,1.234,1.051,1.229,1.232,1.245,1.169,1.068,1.249,1.190,0.891,1.218,1.244,1.212,1.118,1.232,1.120,1.219,0.845,1.145,1.192,1.254,1.207,1.025,1.181,1.187,1.056,1.184,1.071,1.356,1.112,1.220,1.096,1.204,1.224,1.253,1.237,1.222,1.085,1.151,1.230,1.094,1.157,1.147,1.273,1.122,1.075,1.210,1.163,1.157,1.149,0.825,1.318,1.124,1.082,1.183,1.138,1.136,1.112,1.013,1.201,1.004,1.034,1.152,1.040,1.062,1.191,1.133,0.860,0.809,1.127,1.115,0.922,1.218,1.172,1.237,1.159,1.195,0.997,0.897,1.094,1.091,1.131,1.124,0.784,1.089,1.176,1.142,1.131,1.128,1.057,1.082,1.119,1.110,1.265,0.967,1.115,0.897,1.194,1.056,1.230,1.103,1.013,1.121,1.108,1.072,0.885,1.107,1.090,1.112,1.115,1.032,1.089,1.179,1.100,0.820,1.173,1.117,1.122,1.110,1.023,1.190,1.155,1.066,1.017,1.278,1.017,1.133,1.152,1.118,0.792,1.089,1.128,1.027,1.133,1.075,1.080,0.949,1.114,1.112,1.043,1.103,1.031,0.781,1.186,1.084,1.274,1.140,1.092,1.147,1.035,1.085,1.141,0.813,1.113,1.114,1.151,1.177,1.085,1.093,1.123,1.190,1.093,1.247,1.147,1.237,1.223,1.123,1.208,1.266,1.223,0.641,1.007,1.162,0.989,1.137,1.227,1.128,1.206,1.140,1.242,1.298,1.249,1.062,1.102,1.227,0.944,1.123,0.654,1.154,0.786,1.100,1.236,1.126,1.095,1.296,1.228,1.114,1.098,1.227,1.110,1.167,1.277,1.212,1.253,1.163,1.201,1.074,1.111,1.184,1.129,1.201,1.075,0.915,1.111,1.073,0.663,1.139,1.257,1.149,1.109,1.306,1.251,1.085,1.164,1.407,1.149,1.367,1.124,1.136,1.159,1.148,1.042,0.814,1.156,1.129,1.379,1.066,1.079,1.224,1.136,1.131,1.388,0.722,1.092,0.647,1.167,1.031,0.945,1.013,1.132,1.146,1.117,1.250,1.334,0.690,1.395,1.247,1.245,1.067,1.272,1.222,1.484,1.429,1.463,1.417,1.398,1.486,0.955,1.153,1.351,1.190,1.137,0.905,1.122,1.152,1.359,1.062,1.184,1.120,1.416,1.134,1.221,1.137,1.203,1.222,1.440,0.692,1.252,1.494,1.148,1.207,1.235,1.097,1.447,1.223,1.192,0.973,1.172,1.273,1.144,1.124,1.192,1.228,0.659,1.192,1.310,1.182,1.322,1.209,1.116,1.221,1.195,1.371,1.276,1.110,1.314,1.187,1.249,1.117,1.159,1.235,0.887,1.070,1.149,1.314,1.104,1.298,1.295,1.168,1.188,1.047,1.315,0.916,0.646,1.238,0.950,1.257,1.034,0.974,1.138,1.127,0.762,1.123,0.650,1.236,1.052,1.297,1.152,0.795,1.247,1.196,1.315,1.033,1.012,1.162,1.206,1.081,0.631,1.139,0.851,1.307,1.275,0.734,1.141,1.094,1.224,1.112,1.043,1.130,1.163,1.065,1.084,0.971,1.165,0.748,1.079,1.062,1.267,1.147,1.249,1.022,1.088,1.227,1.211,1.113,1.157,1.054,1.149,1.097,1.140,0.924,1.143,1.071,1.093,1.138,1.113,1.018,0.638,1.028,1.138,0.906,1.031,1.036,1.190,1.163,1.037,1.152,1.002,0.803,1.089,1.106,1.167,1.135,1.111,0.847,1.097,1.014,1.113,1.105,1.151,1.107,0.809,1.131,0.924,1.020,1.121,0.883,1.089,1.135,0.888,1.112,1.095,1.038,0.904,0.877,1.096,1.010,1.055,0.997,1.009,1.023,0.742,0.739,1.057,0.915,1.015,1.096,0.827,1.083,0.995,0.642,1.057,0.583,0.965,0.749,0.958,1.029,1.137,0.853,0.944,0.960,0.903,1.088,0.936,1.121,1.080,1.109,1.119,1.109,1.040,1.059,0.677,1.017,0.988,1.014,0.847,0.990,1.013,1.018,0.800,0.836,0.980,0.729,0.979,1.094,1.087,0.855,1.024,1.013,0.785,0.955,0.729,0.982,0.992,1.008,1.022,1.009,0.984,0.999,0.758,1.035,0.991,0.952,1.030,0.830,0.870,0.700,0.987,0.998,0.640,0.954,1.042,0.893,0.965,0.937,1.021,0.975,0.934,0.786,1.037,0.918,0.941,0.738,0.948,0.934,1.175,0.995,1.004,0.654,0.982,1.022,1.024,0.972,1.011,0.913,0.880,0.964,0.788,1.052,0.940,0.907,0.929,0.936,0.887,0.947,0.669,0.899,0.904,0.808,0.945,0.906,0.697,0.972,0.810,0.983,1.028,0.926,0.953,0.952,0.974,0.708,0.978,0.851,0.815,0.910,0.788,0.901,0.946,0.945,1.010,0.968,0.809,1.023,0.958,0.931,0.965,0.843,0.888,1.002,0.939,0.991,0.774,0.969,0.962,0.851,0.693,1.011,1.030,0.795,0.933,0.730,0.916,0.943,0.583,0.914,0.596,0.880,0.875,0.964,0.620,0.555,0.781,0.916,0.921,0.906,0.866,0.944,0.870,0.927,0.942,0.965,0.923,0.920,0.864,0.849,0.875,0.853,1.041,0.916,0.853,0.922,0.769,0.912,0.878,0.872,0.898,0.965,0.980,1.005,0.842,0.637,0.968,0.926,0.928,0.852,0.915,0.922,0.831,1.064,0.849,0.871,0.972,0.953,0.852,0.937,0.861,0.888,0.506,1.006,0.936,0.969,0.898,0.783,1.037,0.802,0.985,1.091,0.876,0.980,0.711,0.883,0.912,0.847,0.812,1.061,0.399,1.033,0.970,1.084,0.870,0.910,0.867,0.989,0.731,0.871,1.095,0.973,0.737,1.039,0.913,0.883,0.830,1.040,0.884,0.674,0.916,0.979,0.986,0.979,0.797,0.607,0.907,0.731,1.029,0.935,1.034,0.841,0.846,1.067,0.894,0.877,0.945,0.623,0.871,0.525,0.852,0.558,0.871,0.667,0.983,0.896,0.839,0.985,1.035,0.965,0.995,0.912,0.978,0.570,0.936,0.952,0.912,0.672,0.921,0.748,0.845,0.912,0.948,0.966,0.325,0.666,0.788,0.708,1.002,0.980,0.742,0.792,0.429,0.644,0.932,0.985,0.921,0.868,0.858,0.897,0.738,0.621,0.882,0.390,0.751,0.683,0.650,0.876,0.481,0.797,0.813,0.466,0.442,0.795,0.794,0.786,0.814,0.880,0.468,0.717,0.704,0.750,0.923,0.902,0.790,0.743,0.943,0.643,0.423,0.763,0.695,0.750,0.590,0.734,0.813,0.664,0.717,0.616,0.450,0.621,0.477,0.648,0.620,0.626,0.670,0.528,0.557,0.638,0.662,0.212,0.651,0.647,0.532,0.558,0.573,0.551,0.512,0.461,0.586,0.446,0.470,0.524,0.454,0.535,0.228,0.552,0.558,0.249,0.411,0.254,0.530]
z2 = [0.700,0.710,0.276,0.641,0.636,0.652,0.577,0.585,0.659,0.732,0.686,0.603,0.697,0.657,0.711,0.642,0.721,0.711,0.723,0.662,0.540,0.469,0.483,0.896,0.667,0.647,0.504,0.740,0.822,0.967,0.707,0.865,0.815,0.755,0.749,1.034,0.769,0.767,0.494,0.820,0.938,0.801,0.865,0.998,0.911,0.876,0.991,0.811,0.774,1.138,0.810,0.805,0.782,0.846,1.012,0.923,0.767,0.398,1.042,0.776,0.937,0.829,0.912,0.858,0.605,0.996,0.981,0.532,0.611,0.870,1.106,0.981,0.550,0.952,0.943,0.962,1.016,0.902,1.044,1.075,1.011,0.988,0.929,1.031,1.077,0.787,1.019,0.925,0.996,0.522,1.169,1.104,0.641,0.832,0.912,0.976,1.041,0.957,1.056,1.171,1.062,1.195,0.948,1.067,1.165,1.020,0.498,0.936,0.694,0.964,1.116,1.019,1.094,0.651,1.111,0.776,0.986,1.107,0.844,0.491,1.084,1.073,1.093,1.141,0.835,1.106,0.845,1.058,0.955,1.166,1.104,0.945,1.097,0.810,1.151,1.051,1.099,1.044,0.522,1.014,1.096,1.052,1.082,1.051,1.093,1.020,0.577,1.078,0.678,1.226,1.073,0.991,1.038,1.161,1.013,0.819,1.084,1.127,1.119,1.111,1.070,0.938,0.881,1.099,1.094,1.100,1.044,1.095,1.064,1.130,0.656,0.982,1.090,1.125,0.871,1.080,1.031,1.029,1.004,1.022,0.946,1.124,1.130,1.118,1.094,1.093,1.052,0.896,1.090,1.058,1.050,1.086,1.100,1.076,0.960,1.134,1.090,0.836,1.064,0.734,1.037,1.128,1.012,1.082,1.144,0.800,0.981,1.109,1.000,1.036,1.031,1.094,1.044,0.976,1.055,1.138,1.021,1.015,0.795,1.035,1.104,0.850,0.928,1.152,0.895,1.119,0.982,1.104,1.104,1.089,0.913,1.059,0.596,0.960,1.129,1.141,1.095,1.082,1.072,0.782,1.168,0.769,1.037,1.060,1.111,1.033,1.016,1.084,1.047,1.004,1.138,1.114,1.061,1.137,1.033,0.946,1.030,0.998,1.003,0.966,1.038,0.501,1.015,0.722,0.654,1.188,1.008,1.117,1.074,0.840,1.162,1.182,1.053,1.216,1.168,0.981,1.043,1.111,0.987,0.944,1.011,1.124,1.097,1.080,1.176,1.030,1.167,1.186,1.168,0.903,1.106,0.700,1.140,1.037,1.154,1.127,0.937,1.101,1.177,1.224,1.039,0.961,1.102,1.060,1.206,1.099,1.163,1.199,0.711,1.031,1.171,1.089,1.216,1.098,1.027,1.143,1.175,0.589,1.134,1.117,1.154,1.152,1.142,0.668,1.232,1.003,1.062,1.103,1.080,1.123,1.104,0.626,1.241,1.177,0.966,1.136,1.059,1.143,1.114,1.062,1.259,1.242,0.743,1.101,1.215,1.069,1.230,1.263,1.101,0.673,1.167,1.147,1.139,1.183,1.297,1.100,0.771,1.139,0.470,1.238,0.878,1.141,1.133,1.089,1.146,1.116,1.220,1.149,0.713,0.538,0.741,1.061,1.091,1.059,1.110,1.074,1.112,1.111,0.905,1.118,1.233,1.322,1.095,1.095,1.253,1.010,1.190,1.182,1.301,1.177,1.184,0.925,1.210,1.129,1.331,1.299,1.111,1.127,0.823,1.123,1.122,0.909,1.218,1.169,1.145,1.168,1.080,1.184,1.348,1.309,0.991,1.080,1.236,1.134,1.173,1.238,1.231,1.170,1.192,1.186,1.176,1.105,1.143,0.727,1.272,0.624,1.080,1.116,1.353,1.091,1.121,1.175,0.774,0.538,1.103,1.157,1.256,1.160,1.038,1.249,1.274,1.138,1.070,1.128,1.161,1.323,1.081,1.217,1.153,1.176,0.598,1.142,1.160,1.071,0.961,1.092,1.275,1.170,0.774,1.276,1.013,1.127,1.240,1.069,1.253,1.171,1.035,1.134,1.259,1.390,1.371,0.563,1.049,1.216,1.152,0.973,1.222,0.844,1.248,0.989,1.105,1.096,1.280,1.259,1.107,1.270,1.162,1.218,1.235,1.115,1.112,0.951,1.181,1.048,1.201,1.107,1.188,1.142,1.238,1.055,1.111,0.997,1.198,1.133,1.043,1.051,1.303,1.275,1.219,1.199,1.162,1.186,1.142,1.292,1.226,1.271,1.290,1.197,1.064,1.168,1.200,1.155,1.139,1.289,1.309,1.106,1.159,1.176,0.659,1.007,1.177,1.110,1.149,1.279,0.440,0.983,0.519,1.118,1.148,1.018,1.140,1.280,1.190,1.133,1.216,0.984,1.017,1.121,1.195,1.131,1.205,1.270,1.072,1.158,1.176,1.173,0.924,1.039,1.063,1.129,1.093,1.035,1.135,1.284,0.940,1.086,1.087,1.189,1.158,1.308,0.930,1.098,0.929,1.162,1.022,1.325,0.974,1.005,0.762,0.903,1.078,1.266,1.170,1.316,0.568,1.202,0.970,1.325,0.913,1.227,1.093,0.970,0.930,0.943,1.088,1.135,1.181,1.026,1.130,0.606,1.107,0.980,1.305,0.978,0.980,0.885,1.133,1.253,1.330,1.006,1.273,1.281,1.085,1.220,1.269,1.284,0.761,1.195,1.155,1.296,1.084,1.100,1.216,1.201,1.078,1.221,1.064,1.137,1.197,1.277,1.154,1.170,0.952,1.216,1.084,1.199,1.165,0.823,1.075,1.147,1.227,1.178,1.120,1.100,1.119,1.247,1.152,1.169,1.242,1.188,1.075,1.330,1.133,1.333,1.075,1.185,1.216,1.071,1.193,1.318,1.295,1.202,0.795,0.718,1.079,1.175,1.122,1.138,1.289,1.086,1.192,1.162,1.260,1.114,0.425,1.366,1.176,1.372,1.073,1.333,1.106,1.080,1.068,1.354,1.064,1.137,1.142,1.147,0.620,1.057,1.074,1.086,0.676,1.113,1.277,1.195,1.057,1.221,1.093,1.219,0.987,1.060,1.010,1.161,1.113,1.217,1.081,0.991,1.126,1.146,0.850,0.982,1.219,1.147,1.039,1.067,1.104,0.567,1.114,1.098,1.210,1.080,1.069,1.125,1.059,0.790,0.958,1.212,1.063,1.141,1.002,1.035,1.053,1.135,1.068,0.668,1.007,1.131,1.010,0.989,0.888,1.032,1.040,0.921,0.759,1.080,1.131,1.086,1.111,1.147,0.857,0.755,1.051,1.066,1.032,1.126,1.071,0.888,0.949,0.833,1.101,1.084,0.921,1.062,0.920,1.045,0.997,0.670,0.893,0.859,0.835,0.938,0.977,1.144,1.002,1.072,0.990,0.891,1.012,0.859,0.979,0.936,1.074,0.969,1.044,1.112,0.687,1.108,0.832,0.714,0.950,0.763,1.032,0.946,0.948,0.684,0.548,0.970,1.092,0.939,0.887,0.740,1.080,1.059,0.927,0.774,0.864,0.914,1.061,0.923,0.877,0.898,0.672,0.877,1.161,1.143,0.852,0.978,1.052,0.831,0.439,0.909,0.880,0.848,1.001,1.057,0.900,0.987,0.854,1.022,1.031,0.839,1.056,0.825,0.513,0.997,0.998,0.728,0.870,0.674,0.941,0.600,0.849,0.848,0.818,0.931,1.004,1.018,1.037,0.836,0.892,0.879,0.975,0.814,0.890,0.926,0.707,0.800,0.672,0.897,0.747,0.677,0.643,0.974,0.808,1.008,0.920,0.854,1.082,0.603,0.950,1.018,0.756,0.888,1.078,1.006,1.013,0.753,1.083,0.840,0.875,0.784,1.139,1.002,0.992,1.060,1.032,1.102,0.462,0.841,1.156,1.038,1.036,0.822,0.819,0.789,1.031,0.861,1.147,1.171,1.074,1.023,1.169,0.496,0.740,0.869,0.873,1.046,0.764,0.679,1.015,1.078,0.989,0.586,0.922,0.562,0.707,0.908,0.892,0.780,0.532,0.866,0.728,0.748,1.235,0.428,0.735,0.936,0.981,1.124,1.021,0.996,0.745,0.866,1.031,0.424,0.706,1.113,0.810,0.938,1.500,0.970,0.651,0.588,1.384,0.937,0.703,0.549,1.051,0.701,1.321,0.989,0.618,1.451,1.291,0.564,0.685,1.031,0.655,0.314,1.375,0.758,0.841,0.833,0.510,1.146,1.262,0.000,0.706,0.778,0.649,0.620,0.909,0.902,0.962,0.734,0.568,0.624,0.864,0.632,0.569,0.778,0.705,0.730,0.732,0.792,0.858,0.900,0.676,0.790,0.749,0.664,0.151,0.655,0.816,0.603,0.555,0.000,0.612,0.630]
def plot_function1(x, y, z):
print('plotting evil plans')
fig = plt.figure(figsize=(36, 32))
ax = fig.add_subplot(111)
ax.tricontourf(x, y, z, np.linspace(min(z), max(z), 1000), cmap='magma', antialiased=False)
plt.close(fig)
def plot_function2(x, y, z):
print('plotting')
fig = plt.figure(figsize=(36, 32))
ax = fig.add_subplot(111)
ax.tricontourf(x, y, z, 1000, cmap='magma', antialiased=False)
plt.close(fig)
x, y, z1, z2 = np.asarray(x), np.asarray(y), np.asarray(z1), np.asarray(z2)
print('shape of x1 = {} and dtype = {}'.format(np.shape(x), x.dtype))
print('shape of y1 = {} and dtype = {}'.format(np.shape(y), y.dtype))
print('shape of z1 = {} and dtype = {}'.format(np.shape(z1), z1.dtype))
print('shape of z2 = {} and dtype = {}'.format(np.shape(z2), z2.dtype))
plot_function1(x, y, z1)
plot_function2(x, y, z1)
plot_function1(x, y, z2)
plot_function2(x, y, z2)
如果位置x和y处的值由z1给出,则上面的示例可以很好地工作,但是无法使用第二版的plot函数进行绘制,即以“ levels”作为整数的参数。
以上代码的完整输出为:
x1的形状=(1000,)和dtype = float64
形状y1 =(1000,)和dtype = float64
z1 =(1000,)和dtype = float64的形状
z2 =(1000,)和dtype = float64的形状
制定邪恶计划
密谋
制定邪恶计划
密谋
追溯(最近一次通话):
中的文件“ stack_example.py”,第40行 plot_function2(x,y,z2)
plot_function2中第27行的文件“ stack_example.py”
ax.tricontourf(x,y,z,1000,cmap ='magma',antialiased = False)
在tricontourf中的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/axes/_axes.py”,行8144
return mtri.tricontourf(self,* args,** kwargs)
在tricontourf中,文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/tri/tricontour.py”,第282行,
返回TriContourSet(ax,* args,** kwargs)
__init__
中的第40行的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/tri/tricontour.py” ContourSet。初始化(自我,斧头,* args,** kwargs)
__init__
中的第890行的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/contour.py” kwargs = self._process_args(* args,** kwargs)
_process_args中第51行的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/tri/tricontour.py”
tri,z = self._contour_args(args,kwargs)
_contour_args中的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/tri/tricontour.py”,第94行,
self._contour_level_args(z,args [1:])
_contour_level_args中的文件“ /home/patrik/.local/lib/python2.7/site-packages/matplotlib/contour.py”,行1220
.format(fn))
类型错误:最后的轮廓参数必须给出级别;参见help(contourf)