From ac5b5370a09cc1df1ff96d0602fe4551c98e1fca Mon Sep 17 00:00:00 2001 From: Ruth Goutkovitch <75093922+ruthgutkovitch@users.noreply.github.com> Date: Sat, 9 Oct 2021 21:33:10 +0300 Subject: [PATCH] commit --- Draw_plots/draw_plots.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Draw_plots/draw_plots.py diff --git a/Draw_plots/draw_plots.py b/Draw_plots/draw_plots.py new file mode 100644 index 00000000..3e126042 --- /dev/null +++ b/Draw_plots/draw_plots.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + + +colors = ["pink","c","lightblue","lavender","lightcoral","wheat","beige"] + +def draw_donut(title,values,names,file_name): + plt.pie(values, autopct='%.2f',colors=colors, rotatelabels =True,labels=names,startangle=150) + circle = plt.Circle(xy=(0,0),radius=0.75,facecolor='white') + plt.gca().add_artist(circle) + plt.title(title) + plt.savefig('/home/ruth/NFT-study/Ruth/Plots/{}.png'.format(file_name)) + +def draw_pie(title,values,names,file_name): + plt.pie(values, autopct='%.2f',colors=colors) + plt.legend(labels=names) + plt.title(title) + plt.savefig('/home/ruth/NFT-study/Ruth/Plots/{}.png'.format(file_name)) + +def draw_plot(x_values,y_values,x_label,y_label,title,file_name): + plt.plot(x_values, y_values) + plt.xlabel (x_label) + plt.ylabel (y_label) + plt.title(title) + plt.xticks(x_values) + plt.yticks(y_values) + plt.savefig('/home/ruth/NFT-study/Ruth/Plots/{}.png'.format(file_name))