質問するログイン新規登録

回答編集履歴

1

追記

2018/05/11 11:31

投稿

hayataka2049
hayataka2049

スコア30939

answer CHANGED
@@ -4,4 +4,51 @@
4
4
 
5
5
  REPLで`import _tkinter`って打ってimportできなかったら、この方法が手っ取り早いと思います。
6
6
 
7
- importできればmatplotlib側の設定でなんとかなる希望もなくはないです。
7
+ importできればmatplotlib側の設定でなんとかなる希望もなくはないです。
8
+
9
+ ### 追記
10
+ 手元で動かした結果、figure1~4の窓が出てきました。
11
+
12
+ ```python
13
+ import matplotlib.pyplot as plt
14
+ import numpy as np
15
+ T = np.arange(10)
16
+ E = np.arange(10)
17
+ SpcH = np.arange(10)
18
+ M = np.arange(10)
19
+ M_sus = np.arange(10)
20
+
21
+ plt.figure()
22
+ plt.plot(T, E, 'rx-')
23
+ plt.xlabel(r'Temperature $(\frac{J}{k_B})$')
24
+ plt.ylabel(r'$\langle E \rangle$ per site $(J)$')
25
+ plt.savefig("E8.pdf", format='pdf', bbox_inches='tight')
26
+
27
+ plt.figure()
28
+ plt.plot(T, SpcH, 'kx-')
29
+ plt.xlabel(r'Temperature $(\frac{J}{k_B})$')
30
+ plt.ylabel(r'$C_V$ per site $(\frac{J^2}{k_B^2})$')
31
+ plt.savefig("Cv8.pdf", format='pdf', bbox_inches='tight')
32
+
33
+ plt.figure()
34
+ plt.plot(T, M, 'bx-')
35
+ plt.xlabel(r'Temperature $(\frac{J}{k_B})$')
36
+ plt.ylabel(r'$\langle|M|\rangle$ per site $(\mu)$')
37
+ plt.savefig("M8.pdf", format='pdf', bbox_inches='tight')
38
+
39
+ plt.figure()
40
+ plt.plot(T, M_sus, 'gx-')
41
+ plt.xlabel(r'Temperature $(\frac{J}{k_B})$')
42
+ plt.ylabel(r'$\chi$ $(\frac{\mu}{k_B})$')
43
+ plt.savefig("chi8.pdf", format='pdf', bbox_inches='tight')
44
+
45
+ plt.tight_layout()
46
+ fig = plt.gcf()
47
+ plt.show()
48
+ ```
49
+
50
+ > In non-interactive mode, display all figures and block until the figures have been closed; in interactive mode it has no effect unless figures were created prior to a change from non-interactive to interactive mode (not recommended). In that case it displays the figures but does not block.
51
+ [matplotlib.pyplot.show — Matplotlib 2.2.2 documentation](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.show.html)
52
+
53
+
54
+ まさかこの処理の前にインタラクティブモードとか使ってたりします?