質問編集履歴
7
情報更新
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,66 +6,9 @@
|
|
6
6
|
x,yは、ともに0~7で固定
|
7
7
|
z軸の値としてセンサから取得するデータを表示したいと考えています。
|
8
8
|
|
9
|
-

|
10
|
-
|
11
9
|
##センサからのデータ
|
12
|
-
センサはアレイ型センサで
|
10
|
+
センサはアレイ型センサです。
|
13
11
|
|
14
|
-
||0|1|2|3|4|5|6|7|
|
15
|
-
|:--|:--:|--:|--:|--:|--:|--:|--:|
|
16
|
-
|0|x|x|x|x|x|x|x|x|
|
17
|
-
|1|x|x|x|x|x|x|x|x|
|
18
|
-
|2|x|x|x|x|x|x|x|x|
|
19
|
-
|3|x|x|x|x|x|x|x|x|
|
20
|
-
|4|x|x|x|x|x|x|x|x|
|
21
|
-
|5|x|x|x|x|x|x|x|x|
|
22
|
-
|6|x|x|x|x|x|x|x|x|
|
23
|
-
|7|x|x|x|x|x|x|x|x|
|
24
|
-
|
25
|
-
**xの部分にデータが入ります。**
|
26
|
-
**取得するデータは次の通りです。**
|
27
|
-
```text
|
28
|
-
[[21.5, 21.0, 21.5, 22.0, 20.75, 21.0, 21.5, 21.0], [20.0, 20.0, 20.25, 20.5, 20.5, 20.75, 20.75, 20.75], [18.5, 19.25, 19.75, 20.0, 20.5, 22.25, 22.5, 21.0], [19.25, 19.25, 19.75, 20.75, 20.0, 22.25, 23.5, 21.25], [20.0, 19.5, 19.25, 19.75, 21.0, 22.5, 23.0, 20.75], [20.25, 19.0, 19.25, 20.25, 20.0, 22.25, 22.25, 22.5], [21.0, 19.0, 19.25, 19.5, 19.75, 20.5, 20.75, 20.75], [22.0, 18.5, 19.5, 19.25, 19.25, 19.75, 20.25, 20.5]]
|
29
|
-
```
|
30
|
-
|
31
12
|
##プログラムコード
|
32
13
|
このコードで、2次元のグラフ表示はできていますが、3次元にする方法が分かりません。
|
33
|
-
教えていただけると助かります。
|
14
|
+
教えていただけると助かります。
|
34
|
-
できれば、温度データなので、z軸の値(センサからのデータ)はカラーマップにしたいです。
|
35
|
-
|
36
|
-
```python
|
37
|
-
# 点を表示する (x, y) 座標を作成
|
38
|
-
X, Y = np.indices(sensordata.shape)
|
39
|
-
|
40
|
-
# 描画する。
|
41
|
-
fig = plt.figure(figsize=(7, 7))
|
42
|
-
axes = fig.add_subplot(111, projection="3d")
|
43
|
-
points = axes.scatter(
|
44
|
-
X.flat, Y.flat, sensordata.flat, c=sensordata.flat, cmap="jet", edgecolor="gray", s=50
|
45
|
-
)
|
46
|
-
|
47
|
-
# カラーバー追加 (xmin, ymin, w, h) でカラーバーを表示する位置を指定
|
48
|
-
cbar_ax = fig.add_axes((0.9, 0.3, 0.02, 0.4))
|
49
|
-
cbar = fig.colorbar(points, cax=cbar_ax)
|
50
|
-
cbar.set_label("Temp")
|
51
|
-
|
52
|
-
#軸ラベル設定
|
53
|
-
axes.set_xlabel("X")
|
54
|
-
axes.set_ylabel("Y")
|
55
|
-
|
56
|
-
#軸目盛設定
|
57
|
-
axes.set_xticks(np.arange(0, 9, 1))
|
58
|
-
axes.set_yticks(np.arange(0, 9, 1))
|
59
|
-
axes.set_zticks((10, 20, 30))
|
60
|
-
|
61
|
-
#Title表示
|
62
|
-
axes.set_title(title, fontsize=16)
|
63
|
-
|
64
|
-
#余白調整
|
65
|
-
plt.subplots_adjust(right=0.85)
|
66
|
-
plt.subplots_adjust(wspace=0.15)
|
67
|
-
|
68
|
-
# 視点
|
69
|
-
axes.view_init(30, -45)
|
70
|
-
```
|
71
|
-

|
6
最新の情報に更新
title
CHANGED
File without changes
|
body
CHANGED
@@ -34,46 +34,38 @@
|
|
34
34
|
できれば、温度データなので、z軸の値(センサからのデータ)はカラーマップにしたいです。
|
35
35
|
|
36
36
|
```python
|
37
|
-
#
|
37
|
+
# 点を表示する (x, y) 座標を作成
|
38
|
-
|
38
|
+
X, Y = np.indices(sensordata.shape)
|
39
39
|
|
40
|
-
#X軸、Y軸データ作成
|
41
|
-
# 2次元グリッド各x、yの位置にsensordataの値をyとして代入
|
42
|
-
array = 8
|
43
|
-
x = np.linspace(0, 7, array)
|
44
|
-
y = np.linspace(0, 7, array)
|
45
|
-
z = np.zeros((len(x), len(y)))
|
46
|
-
for i0 in range(array):
|
47
|
-
for i1 in range(array):
|
48
|
-
z[i1, i0] = sensordata[i0, i1]
|
49
|
-
|
50
|
-
|
51
40
|
# 描画する。
|
52
|
-
fig = plt.figure(figsize=(
|
41
|
+
fig = plt.figure(figsize=(7, 7))
|
53
42
|
axes = fig.add_subplot(111, projection="3d")
|
43
|
+
points = axes.scatter(
|
54
|
-
|
44
|
+
X.flat, Y.flat, sensordata.flat, c=sensordata.flat, cmap="jet", edgecolor="gray", s=50
|
45
|
+
)
|
55
46
|
|
47
|
+
# カラーバー追加 (xmin, ymin, w, h) でカラーバーを表示する位置を指定
|
48
|
+
cbar_ax = fig.add_axes((0.9, 0.3, 0.02, 0.4))
|
49
|
+
cbar = fig.colorbar(points, cax=cbar_ax)
|
50
|
+
cbar.set_label("Temp")
|
51
|
+
|
56
52
|
#軸ラベル設定
|
57
53
|
axes.set_xlabel("X")
|
58
54
|
axes.set_ylabel("Y")
|
55
|
+
|
59
56
|
#軸目盛設定
|
60
57
|
axes.set_xticks(np.arange(0, 9, 1))
|
61
58
|
axes.set_yticks(np.arange(0, 9, 1))
|
59
|
+
axes.set_zticks((10, 20, 30))
|
60
|
+
|
62
61
|
#Title表示
|
63
62
|
axes.set_title(title, fontsize=16)
|
64
63
|
|
65
|
-
axpos = axes.get_position()
|
66
|
-
#Color Bar作成
|
67
|
-
#add_axes([x軸の開始位置, y軸の開始位置, x軸の長さ(全体に対する比率), y軸の長さ(全体に対する比率)])
|
68
|
-
cbar_ax = fig.add_axes([0.85, axpos.y0, 0.02, axpos.height])
|
69
|
-
cbar = fig.colorbar(im,cax=cbar_ax)
|
70
|
-
cbar.set_label("Temp")
|
71
|
-
|
72
64
|
#余白調整
|
73
65
|
plt.subplots_adjust(right=0.85)
|
74
66
|
plt.subplots_adjust(wspace=0.15)
|
67
|
+
|
75
68
|
# 視点
|
76
69
|
axes.view_init(30, -45)
|
77
|
-
plt.savefig('/home/pi/dev/data/3D.png', format='png')
|
78
70
|
```
|
79
|
-

|
5
情報を更新しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
**xの部分にデータが入ります。**
|
26
26
|
**取得するデータは次の通りです。**
|
27
27
|
```text
|
28
|
-
[[
|
28
|
+
[[21.5, 21.0, 21.5, 22.0, 20.75, 21.0, 21.5, 21.0], [20.0, 20.0, 20.25, 20.5, 20.5, 20.75, 20.75, 20.75], [18.5, 19.25, 19.75, 20.0, 20.5, 22.25, 22.5, 21.0], [19.25, 19.25, 19.75, 20.75, 20.0, 22.25, 23.5, 21.25], [20.0, 19.5, 19.25, 19.75, 21.0, 22.5, 23.0, 20.75], [20.25, 19.0, 19.25, 20.25, 20.0, 22.25, 22.25, 22.5], [21.0, 19.0, 19.25, 19.5, 19.75, 20.5, 20.75, 20.75], [22.0, 18.5, 19.5, 19.25, 19.25, 19.75, 20.25, 20.5]]
|
29
29
|
```
|
30
30
|
|
31
31
|
##プログラムコード
|
@@ -35,174 +35,45 @@
|
|
35
35
|
|
36
36
|
```python
|
37
37
|
# データ取得
|
38
|
-
sensordata =
|
38
|
+
sensordata = np.array(linedata)
|
39
39
|
|
40
|
-
#
|
40
|
+
#X軸、Y軸データ作成
|
41
|
+
# 2次元グリッド各x、yの位置にsensordataの値をyとして代入
|
42
|
+
array = 8
|
41
|
-
|
43
|
+
x = np.linspace(0, 7, array)
|
44
|
+
y = np.linspace(0, 7, array)
|
45
|
+
z = np.zeros((len(x), len(y)))
|
46
|
+
for i0 in range(array):
|
47
|
+
for i1 in range(array):
|
42
|
-
|
48
|
+
z[i1, i0] = sensordata[i0, i1]
|
43
|
-
plt.colorbar()
|
44
|
-
```
|
45
49
|
|
46
|
-
Scipyインストール時のエラー
|
47
|
-
```text
|
48
|
-
pi@raspberrypi:~/dev $ pip install scipy
|
49
|
-
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
|
50
|
-
Collecting scipy
|
51
|
-
Downloading https://files.pythonhosted.org/packages/62/4f/7e95c5000c411164d5ca6f55ac54cda5d200a3b6719dafd215ee0bd61578/scipy-1.2.3.tar.gz (23.3MB)
|
52
|
-
100% |????????????????????????????????| 23.3MB 9.0kB/s
|
53
|
-
Building wheels for collected packages: scipy
|
54
|
-
Running setup.py bdist_wheel for scipy ... error
|
55
|
-
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-DRoX0Z --python-tag cp27:
|
56
|
-
Running from scipy source directory.
|
57
|
-
lapack_opt_info:
|
58
|
-
lapack_mkl_info:
|
59
|
-
customize UnixCCompiler
|
60
|
-
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
61
|
-
NOT AVAILABLE
|
62
50
|
|
63
|
-
|
51
|
+
# 描画する。
|
64
|
-
|
52
|
+
fig = plt.figure(figsize=(8, 8))
|
65
|
-
|
53
|
+
axes = fig.add_subplot(111, projection="3d")
|
66
|
-
|
54
|
+
im = axes.plot_surface(x, y, z, cmap="magma", edgecolor="gray")
|
67
|
-
NOT AVAILABLE
|
68
55
|
|
56
|
+
#軸ラベル設定
|
69
|
-
|
57
|
+
axes.set_xlabel("X")
|
58
|
+
axes.set_ylabel("Y")
|
59
|
+
#軸目盛設定
|
60
|
+
axes.set_xticks(np.arange(0, 9, 1))
|
61
|
+
axes.set_yticks(np.arange(0, 9, 1))
|
62
|
+
#Title表示
|
70
|
-
|
63
|
+
axes.set_title(title, fontsize=16)
|
71
|
-
customize UnixCCompiler
|
72
|
-
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
73
|
-
NOT AVAILABLE
|
74
64
|
|
75
|
-
|
65
|
+
axpos = axes.get_position()
|
66
|
+
#Color Bar作成
|
76
|
-
|
67
|
+
#add_axes([x軸の開始位置, y軸の開始位置, x軸の長さ(全体に対する比率), y軸の長さ(全体に対する比率)])
|
77
|
-
|
68
|
+
cbar_ax = fig.add_axes([0.85, axpos.y0, 0.02, axpos.height])
|
78
|
-
numpy/distutils/site.cfg file (section [atlas]) or by setting
|
79
|
-
|
69
|
+
cbar = fig.colorbar(im,cax=cbar_ax)
|
80
|
-
self.calc_info()
|
81
|
-
lapack_info:
|
82
|
-
|
70
|
+
cbar.set_label("Temp")
|
83
|
-
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
84
|
-
NOT AVAILABLE
|
85
71
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
96
|
-
Lapack (http://www.netlib.org/lapack/) sources not found.
|
97
|
-
Directories to search for the sources can be specified in the
|
98
|
-
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
|
99
|
-
the LAPACK_SRC environment variable.
|
100
|
-
self.calc_info()
|
101
|
-
NOT AVAILABLE
|
102
|
-
|
103
|
-
Traceback (most recent call last):
|
104
|
-
File "<string>", line 1, in <module>
|
105
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 492, in <module>
|
106
|
-
setup_package()
|
107
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 488, in setup_package
|
108
|
-
setup(**metadata)
|
109
|
-
File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 137, in setup
|
110
|
-
config = configuration()
|
111
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 395, in configuration
|
112
|
-
raise NotFoundError(msg)
|
113
|
-
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
|
114
|
-
|
115
|
-
----------------------------------------
|
116
|
-
Failed building wheel for scipy
|
117
|
-
Running setup.py clean for scipy
|
118
|
-
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
|
119
|
-
|
120
|
-
`setup.py clean` is not supported, use one of the following instead:
|
121
|
-
|
122
|
-
- `git clean -xdf` (cleans all files)
|
123
|
-
- `git clean -Xdf` (cleans all versioned files, doesn't touch
|
124
|
-
files that aren't checked into the git repo)
|
125
|
-
|
126
|
-
Add `--force` to your command to use it anyway if you must (unsupported).
|
127
|
-
|
128
|
-
|
129
|
-
----------------------------------------
|
130
|
-
Failed cleaning build dir for scipy
|
131
|
-
Failed to build scipy
|
132
|
-
Installing collected packages: scipy
|
133
|
-
Running setup.py install for scipy ... error
|
134
|
-
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-e3RwQy/install-record.txt --single-version-externally-managed --compile --user --prefix=:
|
135
|
-
|
136
|
-
Note: if you need reliable uninstall behavior, then install
|
137
|
-
with pip instead of using `setup.py install`:
|
138
|
-
|
139
|
-
- `pip install .` (from a git repo or downloaded source
|
140
|
-
release)
|
141
|
-
- `pip install scipy` (last SciPy release on PyPI)
|
142
|
-
|
143
|
-
|
144
|
-
Running from scipy source directory.
|
145
|
-
lapack_opt_info:
|
146
|
-
lapack_mkl_info:
|
147
|
-
customize UnixCCompiler
|
148
|
-
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
149
|
-
NOT AVAILABLE
|
150
|
-
|
151
|
-
openblas_lapack_info:
|
152
|
-
customize UnixCCompiler
|
153
|
-
customize UnixCCompiler
|
154
|
-
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
155
|
-
NOT AVAILABLE
|
156
|
-
|
157
|
-
openblas_clapack_info:
|
158
|
-
customize UnixCCompiler
|
159
|
-
customize UnixCCompiler
|
160
|
-
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
161
|
-
NOT AVAILABLE
|
162
|
-
accelerate_info:
|
163
|
-
NOT AVAILABLE
|
164
|
-
|
165
|
-
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
166
|
-
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
|
167
|
-
Directories to search for the libraries can be specified in the
|
168
|
-
numpy/distutils/site.cfg file (section [atlas]) or by setting
|
169
|
-
the ATLAS environment variable.
|
170
|
-
self.calc_info()
|
171
|
-
lapack_info:
|
172
|
-
customize UnixCCompiler
|
173
|
-
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
174
|
-
NOT AVAILABLE
|
175
|
-
|
176
|
-
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
177
|
-
Lapack (http://www.netlib.org/lapack/) libraries not found.
|
178
|
-
Directories to search for the libraries can be specified in the
|
179
|
-
numpy/distutils/site.cfg file (section [lapack]) or by setting
|
180
|
-
the LAPACK environment variable.
|
181
|
-
self.calc_info()
|
182
|
-
lapack_src_info:
|
183
|
-
NOT AVAILABLE
|
184
|
-
|
185
|
-
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
186
|
-
Lapack (http://www.netlib.org/lapack/) sources not found.
|
187
|
-
Directories to search for the sources can be specified in the
|
188
|
-
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
|
189
|
-
the LAPACK_SRC environment variable.
|
190
|
-
self.calc_info()
|
191
|
-
NOT AVAILABLE
|
192
|
-
|
193
|
-
Traceback (most recent call last):
|
194
|
-
File "<string>", line 1, in <module>
|
195
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 492, in <module>
|
196
|
-
setup_package()
|
197
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 488, in setup_package
|
198
|
-
setup(**metadata)
|
199
|
-
File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 137, in setup
|
200
|
-
config = configuration()
|
201
|
-
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 395, in configuration
|
202
|
-
raise NotFoundError(msg)
|
203
|
-
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
|
204
|
-
|
205
|
-
----------------------------------------
|
206
|
-
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-e3RwQy/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-FqXt9K/scipy/
|
207
|
-
コード
|
208
|
-
```
|
72
|
+
#余白調整
|
73
|
+
plt.subplots_adjust(right=0.85)
|
74
|
+
plt.subplots_adjust(wspace=0.15)
|
75
|
+
# 視点
|
76
|
+
axes.view_init(30, -45)
|
77
|
+
plt.savefig('/home/pi/dev/data/3D.png', format='png')
|
78
|
+
```
|
79
|
+

|
4
scipyインストール時のエラー情報を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -43,118 +43,166 @@
|
|
43
43
|
plt.colorbar()
|
44
44
|
```
|
45
45
|
|
46
|
-
|
46
|
+
Scipyインストール時のエラー
|
47
|
+
```text
|
48
|
+
pi@raspberrypi:~/dev $ pip install scipy
|
49
|
+
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
|
50
|
+
Collecting scipy
|
51
|
+
Downloading https://files.pythonhosted.org/packages/62/4f/7e95c5000c411164d5ca6f55ac54cda5d200a3b6719dafd215ee0bd61578/scipy-1.2.3.tar.gz (23.3MB)
|
52
|
+
100% |????????????????????????????????| 23.3MB 9.0kB/s
|
53
|
+
Building wheels for collected packages: scipy
|
54
|
+
Running setup.py bdist_wheel for scipy ... error
|
55
|
+
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-DRoX0Z --python-tag cp27:
|
56
|
+
Running from scipy source directory.
|
57
|
+
lapack_opt_info:
|
58
|
+
lapack_mkl_info:
|
59
|
+
customize UnixCCompiler
|
60
|
+
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
61
|
+
NOT AVAILABLE
|
47
62
|
|
48
|
-
```python
|
49
|
-
linedata=[]
|
50
|
-
for i in range(8) :
|
51
|
-
data = bus.read_i2c_block_data(i2c_address , 0x80+0x10*i, 16)
|
52
|
-
oneline =[]
|
53
|
-
for j in range(8) :
|
54
|
-
oneline.append( (int(((data[2*j+1] & 0b00000111) << 8) + data[2*j]))*0.25 )
|
55
|
-
|
63
|
+
openblas_lapack_info:
|
64
|
+
customize UnixCCompiler
|
65
|
+
customize UnixCCompiler
|
66
|
+
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
67
|
+
NOT AVAILABLE
|
56
68
|
|
57
|
-
|
69
|
+
openblas_clapack_info:
|
70
|
+
customize UnixCCompiler
|
71
|
+
customize UnixCCompiler
|
72
|
+
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
58
|
-
|
73
|
+
NOT AVAILABLE
|
59
74
|
|
75
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
76
|
+
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
|
77
|
+
Directories to search for the libraries can be specified in the
|
78
|
+
numpy/distutils/site.cfg file (section [atlas]) or by setting
|
60
|
-
|
79
|
+
the ATLAS environment variable.
|
61
|
-
|
80
|
+
self.calc_info()
|
62
|
-
|
81
|
+
lapack_info:
|
82
|
+
customize UnixCCompiler
|
83
|
+
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
84
|
+
NOT AVAILABLE
|
63
85
|
|
86
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
64
|
-
|
87
|
+
Lapack (http://www.netlib.org/lapack/) libraries not found.
|
65
|
-
xn = 8
|
66
|
-
x0 = np.linspace(0, 7, xn)
|
67
|
-
x1 = np.linspace(0, 7, xn)
|
68
|
-
|
88
|
+
Directories to search for the libraries can be specified in the
|
69
|
-
|
89
|
+
numpy/distutils/site.cfg file (section [lapack]) or by setting
|
70
|
-
for i1 in range(xn):
|
71
|
-
|
90
|
+
the LAPACK environment variable.
|
91
|
+
self.calc_info()
|
92
|
+
lapack_src_info:
|
93
|
+
NOT AVAILABLE
|
72
94
|
|
95
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
96
|
+
Lapack (http://www.netlib.org/lapack/) sources not found.
|
73
|
-
|
97
|
+
Directories to search for the sources can be specified in the
|
98
|
+
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
|
74
|
-
|
99
|
+
the LAPACK_SRC environment variable.
|
100
|
+
self.calc_info()
|
101
|
+
NOT AVAILABLE
|
75
102
|
|
103
|
+
Traceback (most recent call last):
|
104
|
+
File "<string>", line 1, in <module>
|
105
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 492, in <module>
|
76
|
-
|
106
|
+
setup_package()
|
107
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 488, in setup_package
|
108
|
+
setup(**metadata)
|
109
|
+
File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 137, in setup
|
77
|
-
|
110
|
+
config = configuration()
|
111
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 395, in configuration
|
112
|
+
raise NotFoundError(msg)
|
78
|
-
|
113
|
+
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
|
79
114
|
|
80
|
-
|
81
|
-
|
115
|
+
----------------------------------------
|
116
|
+
Failed building wheel for scipy
|
117
|
+
Running setup.py clean for scipy
|
118
|
+
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
|
82
119
|
|
83
|
-
# 曲面データを基に、カラーバーを描く
|
84
|
-
|
120
|
+
`setup.py clean` is not supported, use one of the following instead:
|
85
121
|
|
86
|
-
# Z軸目盛り
|
87
|
-
|
122
|
+
- `git clean -xdf` (cleans all files)
|
123
|
+
- `git clean -Xdf` (cleans all versioned files, doesn't touch
|
124
|
+
files that aren't checked into the git repo)
|
88
125
|
|
89
|
-
# タイトル
|
90
|
-
|
126
|
+
Add `--force` to your command to use it anyway if you must (unsupported).
|
91
127
|
|
92
|
-
# 視点
|
93
|
-
ax.view_init(30, -10)
|
94
128
|
|
95
|
-
|
96
|
-
|
129
|
+
----------------------------------------
|
130
|
+
Failed cleaning build dir for scipy
|
131
|
+
Failed to build scipy
|
132
|
+
Installing collected packages: scipy
|
133
|
+
Running setup.py install for scipy ... error
|
134
|
+
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-e3RwQy/install-record.txt --single-version-externally-managed --compile --user --prefix=:
|
97
135
|
|
98
|
-
|
99
|
-
|
100
|
-
```text
|
101
|
-
[[24.0, 24.0, 24.5, 23.5, 23.25, 25.0, 25.5, 25.0], [22.5, 25.25, 26.0, 25.75, 25.75, 26.0, 26.25, 26.25], [26.0, 25.5, 25.0, 26.5, 26.25, 27.0, 27.25, 27.0], [25.75, 26.0, 27.0, 27.5, 27.25, 28.0, 28.0, 28.0], [23.0, 22.75, 24.75, 27.0, 27.75, 27.75, 28.5, 27.75], [24.5, 25.5, 26.25, 26.25, 27.25, 28.0, 27.5, 27.75], [22.25, 23.0, 24.0, 25.75, 27.25, 27.5, 27.5, 27.5], [21.0, 20.25, 23.0, 25.75, 26.5, 26.0, 25.75, 25.75]]
|
102
|
-
Traceback (most recent call last):
|
103
|
-
File "./test.py", line 59, in <module>
|
104
|
-
ax = plt.subplot(1, 1, 1, projection='3d')
|
105
|
-
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1057, in subplot
|
106
|
-
a = fig.add_subplot(*args, **kwargs)
|
107
|
-
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 1239, in add_subplot
|
108
|
-
self, *args, **kwargs)
|
109
|
-
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/projections/__init__.py", line 91, in process_projection_requirements
|
110
|
-
projection_class = get_projection_class(projection)
|
111
|
-
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/projections/__init__.py", line 65, in get_projection_class
|
112
|
-
raise ValueError("Unknown projection '%s'" % projection)
|
113
|
-
ValueError: Unknown projection '3d'
|
114
|
-
```
|
136
|
+
Note: if you need reliable uninstall behavior, then install
|
137
|
+
with pip instead of using `setup.py install`:
|
115
138
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
139
|
+
- `pip install .` (from a git repo or downloaded source
|
140
|
+
release)
|
141
|
+
- `pip install scipy` (last SciPy release on PyPI)
|
142
|
+
|
143
|
+
|
144
|
+
Running from scipy source directory.
|
145
|
+
lapack_opt_info:
|
146
|
+
lapack_mkl_info:
|
147
|
+
customize UnixCCompiler
|
148
|
+
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
149
|
+
NOT AVAILABLE
|
150
|
+
|
151
|
+
openblas_lapack_info:
|
152
|
+
customize UnixCCompiler
|
153
|
+
customize UnixCCompiler
|
154
|
+
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
155
|
+
NOT AVAILABLE
|
156
|
+
|
157
|
+
openblas_clapack_info:
|
158
|
+
customize UnixCCompiler
|
159
|
+
customize UnixCCompiler
|
160
|
+
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
161
|
+
NOT AVAILABLE
|
162
|
+
accelerate_info:
|
163
|
+
NOT AVAILABLE
|
164
|
+
|
165
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
166
|
+
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
|
167
|
+
Directories to search for the libraries can be specified in the
|
168
|
+
numpy/distutils/site.cfg file (section [atlas]) or by setting
|
169
|
+
the ATLAS environment variable.
|
170
|
+
self.calc_info()
|
171
|
+
lapack_info:
|
172
|
+
customize UnixCCompiler
|
173
|
+
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf']
|
174
|
+
NOT AVAILABLE
|
175
|
+
|
176
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
177
|
+
Lapack (http://www.netlib.org/lapack/) libraries not found.
|
178
|
+
Directories to search for the libraries can be specified in the
|
179
|
+
numpy/distutils/site.cfg file (section [lapack]) or by setting
|
180
|
+
the LAPACK environment variable.
|
181
|
+
self.calc_info()
|
182
|
+
lapack_src_info:
|
183
|
+
NOT AVAILABLE
|
184
|
+
|
185
|
+
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:638: UserWarning:
|
186
|
+
Lapack (http://www.netlib.org/lapack/) sources not found.
|
187
|
+
Directories to search for the sources can be specified in the
|
188
|
+
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
|
189
|
+
the LAPACK_SRC environment variable.
|
190
|
+
self.calc_info()
|
191
|
+
NOT AVAILABLE
|
192
|
+
|
193
|
+
Traceback (most recent call last):
|
194
|
+
File "<string>", line 1, in <module>
|
195
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 492, in <module>
|
196
|
+
setup_package()
|
197
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 488, in setup_package
|
198
|
+
setup(**metadata)
|
199
|
+
File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 137, in setup
|
200
|
+
config = configuration()
|
201
|
+
File "/tmp/pip-install-FqXt9K/scipy/setup.py", line 395, in configuration
|
202
|
+
raise NotFoundError(msg)
|
203
|
+
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
|
204
|
+
|
205
|
+
----------------------------------------
|
206
|
+
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-FqXt9K/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-e3RwQy/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-FqXt9K/scipy/
|
157
207
|
コード
|
158
|
-
```
|
208
|
+
```
|
159
|
-
|
160
|
-

|
3
画像を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -155,4 +155,6 @@
|
|
155
155
|
"matplotlib display text must have all code points < 128 or use "
|
156
156
|
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
|
157
157
|
コード
|
158
|
-
```
|
158
|
+
```
|
159
|
+
|
160
|
+

|
2
エラー情報の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -111,4 +111,48 @@
|
|
111
111
|
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/projections/__init__.py", line 65, in get_projection_class
|
112
112
|
raise ValueError("Unknown projection '%s'" % projection)
|
113
113
|
ValueError: Unknown projection '3d'
|
114
|
+
```
|
115
|
+
|
116
|
+
最新のエラー
|
117
|
+
```text
|
118
|
+
[[21.25, 19.75, 21.25, 22.0, 22.25, 22.25, 22.75, 22.0], [21.75, 22.0, 20.25, 21.0, 23.5, 22.25, 23.25, 23.25], [19.5, 22.5, 22.75, 21.75, 23.5, 24.25, 24.75, 24.0], [19.0, 20.25, 22.75, 23.75, 23.75, 24.5, 25.25, 25.25], [18.75, 18.0, 20.0, 23.25, 24.5, 25.0, 25.5, 25.25], [18.5, 18.5, 19.0, 20.75, 24.5, 24.75, 24.5, 25.25], [19.5, 20.75, 22.5, 21.25, 22.75, 24.25, 24.5, 24.75], [20.0, 19.0, 21.75, 23.0, 24.0, 23.25, 23.75, 24.5]]
|
119
|
+
Traceback (most recent call last):
|
120
|
+
File "./test.py", line 77, in <module>
|
121
|
+
plt.savefig('/home/pi/dev/data/3D.png', format='png')
|
122
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 695, in savefig
|
123
|
+
res = fig.savefig(*args, **kwargs)
|
124
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 2062, in savefig
|
125
|
+
self.canvas.print_figure(fname, **kwargs)
|
126
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2263, in print_figure
|
127
|
+
**kwargs)
|
128
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 517, in print_png
|
129
|
+
FigureCanvasAgg.draw(self)
|
130
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 437, in draw
|
131
|
+
self.figure.draw(self.renderer)
|
132
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
|
133
|
+
return draw(artist, renderer, *args, **kwargs)
|
134
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 1493, in draw
|
135
|
+
renderer, self, artists, self.suppressComposite)
|
136
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/image.py", line 141, in _draw_list_compositing_images
|
137
|
+
a.draw(renderer)
|
138
|
+
File "/home/pi/.local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 301, in draw
|
139
|
+
super(Axes3D, self).draw(renderer)
|
140
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
|
141
|
+
return draw(artist, renderer, *args, **kwargs)
|
142
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2635, in draw
|
143
|
+
mimage._draw_list_compositing_images(renderer, self, artists)
|
144
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/image.py", line 141, in _draw_list_compositing_images
|
145
|
+
a.draw(renderer)
|
146
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
|
147
|
+
return draw(artist, renderer, *args, **kwargs)
|
148
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/text.py", line 706, in draw
|
149
|
+
bbox, info, descent = textobj._get_layout(renderer)
|
150
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/text.py", line 305, in _get_layout
|
151
|
+
clean_line, ismath = self.is_math_text(line, self.get_usetex())
|
152
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/text.py", line 1190, in is_math_text
|
153
|
+
if cbook.is_math_text(s):
|
154
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/cbook/__init__.py", line 2035, in is_math_text
|
155
|
+
"matplotlib display text must have all code points < 128 or use "
|
156
|
+
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
|
157
|
+
コード
|
114
158
|
```
|
1
エラー内容を追記。
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,4 +41,74 @@
|
|
41
41
|
plt.subplot(1, 2, 1)
|
42
42
|
fig = plt.imshow(sensordata, cmap="inferno")
|
43
43
|
plt.colorbar()
|
44
|
+
```
|
45
|
+
|
46
|
+
**追加**
|
47
|
+
|
48
|
+
```python
|
49
|
+
linedata=[]
|
50
|
+
for i in range(8) :
|
51
|
+
data = bus.read_i2c_block_data(i2c_address , 0x80+0x10*i, 16)
|
52
|
+
oneline =[]
|
53
|
+
for j in range(8) :
|
54
|
+
oneline.append( (int(((data[2*j+1] & 0b00000111) << 8) + data[2*j]))*0.25 )
|
55
|
+
linedata.append(oneline)
|
56
|
+
|
57
|
+
#配列データ表示
|
58
|
+
print linedata
|
59
|
+
|
60
|
+
indata = np.array(linedata)
|
61
|
+
# 温度データの形状を確認
|
62
|
+
indata.shape
|
63
|
+
|
64
|
+
# 2次元グリッド各x0、x1の位置にindataの値をyとして代入
|
65
|
+
xn = 8
|
66
|
+
x0 = np.linspace(0, 7, xn)
|
67
|
+
x1 = np.linspace(0, 7, xn)
|
68
|
+
y = np.zeros((len(x0), len(x1)))
|
69
|
+
for i0 in range(xn):
|
70
|
+
for i1 in range(xn):
|
71
|
+
y[i1, i0] = indata[i0, i1]
|
72
|
+
|
73
|
+
# 3次元グリッドを作成
|
74
|
+
xx0, xx1 = np.meshgrid(x0, x1)
|
75
|
+
|
76
|
+
# 作画領域
|
77
|
+
plt.figure(figsize=(10, 7))
|
78
|
+
ax = plt.subplot(1, 1, 1, projection='3d')
|
79
|
+
|
80
|
+
# 3次元グリッドに温度データとカラーマップを与えて曲面を描く
|
81
|
+
surf = ax.plot_surface(xx0, xx1, y, cmap = "autumn_r", edgecolor='gray')
|
82
|
+
|
83
|
+
# 曲面データを基に、カラーバーを描く
|
84
|
+
plt.colorbar(surf)
|
85
|
+
|
86
|
+
# Z軸目盛り
|
87
|
+
ax.set_zticks((10, 20, 30))
|
88
|
+
|
89
|
+
# タイトル
|
90
|
+
ax.set_title("温度分布")
|
91
|
+
|
92
|
+
# 視点
|
93
|
+
ax.view_init(30, -10)
|
94
|
+
|
95
|
+
plt.savefig('/home/pi/3D.png', format='png')
|
96
|
+
```
|
97
|
+
|
98
|
+
次のエラーが出てしまいました。
|
99
|
+
**print linedata**でデータ取得まではできているのですが、グラフ化ができません。
|
100
|
+
```text
|
101
|
+
[[24.0, 24.0, 24.5, 23.5, 23.25, 25.0, 25.5, 25.0], [22.5, 25.25, 26.0, 25.75, 25.75, 26.0, 26.25, 26.25], [26.0, 25.5, 25.0, 26.5, 26.25, 27.0, 27.25, 27.0], [25.75, 26.0, 27.0, 27.5, 27.25, 28.0, 28.0, 28.0], [23.0, 22.75, 24.75, 27.0, 27.75, 27.75, 28.5, 27.75], [24.5, 25.5, 26.25, 26.25, 27.25, 28.0, 27.5, 27.75], [22.25, 23.0, 24.0, 25.75, 27.25, 27.5, 27.5, 27.5], [21.0, 20.25, 23.0, 25.75, 26.5, 26.0, 25.75, 25.75]]
|
102
|
+
Traceback (most recent call last):
|
103
|
+
File "./test.py", line 59, in <module>
|
104
|
+
ax = plt.subplot(1, 1, 1, projection='3d')
|
105
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1057, in subplot
|
106
|
+
a = fig.add_subplot(*args, **kwargs)
|
107
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 1239, in add_subplot
|
108
|
+
self, *args, **kwargs)
|
109
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/projections/__init__.py", line 91, in process_projection_requirements
|
110
|
+
projection_class = get_projection_class(projection)
|
111
|
+
File "/home/pi/.local/lib/python2.7/site-packages/matplotlib/projections/__init__.py", line 65, in get_projection_class
|
112
|
+
raise ValueError("Unknown projection '%s'" % projection)
|
113
|
+
ValueError: Unknown projection '3d'
|
44
114
|
```
|