From cbc3a2daa59afd41871c4bacdf6103f85f54d145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=BC=E5=B0=8F=E8=BE=89=E4=B8=B6?= <760198141@qq.com> Date: Wed, 13 Oct 2021 13:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Matplotlib Drawing/Problem 3/A.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Matplotlib Drawing/Problem 3/A.py diff --git a/Matplotlib Drawing/Problem 3/A.py b/Matplotlib Drawing/Problem 3/A.py new file mode 100644 index 0000000..e84547d --- /dev/null +++ b/Matplotlib Drawing/Problem 3/A.py @@ -0,0 +1,8 @@ +import numpy as np +import matplotlib.pyplot as plt +data = [[10., 20., 30., 20.],[40., 25., 53., 18.],[6., 22., 52., 19.]] +x = np.arange(4) +colors = ['r', 'g', 'b'] +for i in range(len(data)): + plt.bar(x + i * 0.25, data[:i], color = colors[i], width = 0.25) +plt.show() \ No newline at end of file -- GitLab