回答編集履歴
2
修正
answer
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
matplotlib の Figure を画像化して base64 文字列に変換し、[インライン画像](https://dev.classmethod.jp/articles/image-performance-tuning-03/) として、テンプレート上に `img` タグで表示すればいいと思います。
|
2
2
|
|
3
|
-
index.html
|
3
|
+
templates/index.html
|
4
4
|
```
|
5
5
|
<img src="data:image/png;base64,{{ img }}" />
|
6
6
|
```
|
7
7
|
|
8
|
-
|
8
|
+
main.py
|
9
|
-
|
10
9
|
```python
|
11
10
|
import base64
|
12
11
|
from io import BytesIO
|
1
修正
answer
CHANGED
@@ -63,4 +63,6 @@
|
|
63
63
|
|
64
64
|
----
|
65
65
|
|
66
|
-
[Github](https://github.com/nekobean/snippets/tree/master/319114) に動作するコード全体を載せましたので、なにか疑問点があったらコメントしてください。
|
66
|
+
[Github](https://github.com/nekobean/snippets/tree/master/319114) に動作するコード全体を載せましたので、なにか疑問点があったらコメントしてください。
|
67
|
+
|
68
|
+

|