From 8a3eb926605d5d1de1e112c8e9a0c42477e79b5b Mon Sep 17 00:00:00 2001 From: niveditajain001 Date: Wed, 29 Oct 2025 22:36:25 +0530 Subject: [PATCH] new program --- bar graph plot | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bar graph plot diff --git a/bar graph plot b/bar graph plot new file mode 100644 index 00000000..5810ad4a --- /dev/null +++ b/bar graph plot @@ -0,0 +1,19 @@ +import matplotlib.pyplot as plt +import numpy as np + +y1 = [1,2,3,4] + +y2 = [1,2,3,4] +y3=[1,2,3,4] +tick_label = ['one', 'two', 'three', 'four'] + +plt.bar(np.arange(len(y1))-0.2,y1,tick_label =tick_label, width=0.4,) + +plt.bar(np.arange(len(y2))+0.2,y2,tick_label =tick_label, width=0.4) +plt.bar(np.arange(len(y3))+0.4,y3,color='green',tick_label =tick_label, width=0.4) + +plt.title('my bar chart') + +plt.legend(labels=['a','b']) + +plt.show() \ No newline at end of file