From 8726c438f009053135e19f62c4c0344932d08fff Mon Sep 17 00:00:00 2001 From: Heiko J Schick Date: Sun, 21 Nov 2021 19:14:31 +0100 Subject: [PATCH] Moved legend to the right side, added citation --- data_visualisation.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/data_visualisation.py b/data_visualisation.py index cb6c19a..732c6a9 100644 --- a/data_visualisation.py +++ b/data_visualisation.py @@ -47,6 +47,7 @@ plt.rcParams["figure.figsize"] = (16,9) plt.rcParams["lines.markersize"] = 8 plt.yscale('log') plt.grid(True) +plt.subplots_adjust(right = 0.8) x = df_transistors.year y = df_transistors.transistors @@ -74,7 +75,20 @@ plt.legend(["Transistors (thousands)", "Typical power (Watts)", "Number of logical cores"], loc = "upper left", + bbox_to_anchor=(1.0, 1.0), fontsize = "medium") +plt.text(100, 100, "This is a text") + +plt.text(0.805, 0.155, + "Original data up to the year 2010 collected and plotted by\nM. Horowitz, F. Labonte, O. Shacham, K. Olukotun, \nL. Hammond, and C. Batten.", + fontsize = "x-small", + transform=plt.gcf().transFigure) + +plt.text(0.805, 0.125, + "New plot and data collected for 2010-2017 by K. Rupp.", + fontsize = "x-small", + transform=plt.gcf().transFigure) + plt.savefig("data_visualisation.png", dpi = 300, orientation = "landscape", papertype ="a4") -plt.show() \ No newline at end of file +plt.show()