回答編集履歴

1

d

2019/10/29 07:33

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -33,3 +33,65 @@
33
33
 
34
34
 
35
35
  ![イメージ説明](5cafa9e05dd81f0be155165099689339.png)
36
+
37
+
38
+
39
+ ## 追記
40
+
41
+
42
+
43
+ 以下のようにしてみてはどうでしょうか。
44
+
45
+
46
+
47
+ ```python
48
+
49
+ fig, ax = plt.subplots(figsize=(5, 5))
50
+
51
+
52
+
53
+ x1 = np.linspace(0, 10, 1000)
54
+
55
+ y1 = np.sin(x1)
56
+
57
+
58
+
59
+ x2 = np.linspace(0, 10, 100)
60
+
61
+ y2 = np.cos(x2)
62
+
63
+
64
+
65
+ ax.plot(x1, y1, "k", label="sin")
66
+
67
+ ax.plot(x2, y2, "k", label="cos")
68
+
69
+ ax.legend()
70
+
71
+
72
+
73
+ ax.fill(np.append(x1, x2[::-1]), np.append(y1, y2[::-1]))
74
+
75
+ ```
76
+
77
+
78
+
79
+ コメントのコードの場合以下
80
+
81
+
82
+
83
+ ```python
84
+
85
+ plt.plot(
86
+
87
+ x1_list, z1_list, color="Black", alpha=0.5, linewidth=4.0, label="data1"
88
+
89
+ )
90
+
91
+ plt.plot(x2_list, z2_list, color="Black", alpha=0.8, linewidth=4.0, label="data2")
92
+
93
+ plt.legend()
94
+
95
+ ax.fill(np.append(x1_list, x2_list[::-1]), np.append(z1_list, z2_list[::-1]))
96
+
97
+ ```