Переглянути джерело

db analyser: set font sizes

Bernadette Elena Hammerle 3 роки тому
батько
коміт
00cc28f94d
1 змінених файлів з 14 додано та 11 видалено
  1. 14 11
      src/database/dbAnalyser.py

+ 14 - 11
src/database/dbAnalyser.py

@@ -35,6 +35,8 @@ def readFile():
 
 def timeMaps(df, plotTitle="maps.png"):
     fig, ax = plt.subplots(figsize=(20,12))
+    plt.yticks(fontsize=15)
+    plt.xticks(fontsize=15)
     for mapId, mapDf in df.groupby(["id"]):
         if mapId != "mapbox":
             ax.scatter(mapDf["markers"], mapDf["time"], color=colorLookup.get(mapId))
@@ -47,18 +49,19 @@ def timeMaps(df, plotTitle="maps.png"):
                 typeMapAvgDf = typeDf.groupby(["markers"]).mean().reset_index()
                 ax.plot(typeMapAvgDf["markers"], typeMapAvgDf["time"], label=mapTypeId, color=colorLookup.get(mapTypeId))
 
-    ax.legend(title="Maps")
-    ax.legend(title="Marker Type")
-    ax.set_xlabel("Number of Markers", fontsize=15)
-    ax.set_ylabel("Time (ms)", fontsize=15)
-    ax.set_title("Map Libraries", fontsize=20)
+    ax.legend(title="Marker Type", fontsize=17, title_fontsize=20)
+    ax.set_xlabel("Number of Markers", fontsize=20)
+    ax.set_ylabel("Time (ms)", fontsize=20)
+    ax.set_title("Map Libraries - Marker", fontsize=25)
     folder = os.path.dirname(os.path.abspath(__file__)) + "/plots/"
-    plt.savefig(folder + plotTitle)
+    plt.savefig(folder + plotTitle, bbox_inches="tight")
 
 
 def mapboxTypes(df, plotTitle="mapbox.png"):
     mapboxDf = df.dropna(subset=["type"])
     fig, ax = plt.subplots(figsize=(20,12))
+    plt.yticks(fontsize=15)
+    plt.xticks(fontsize=15)
     for markerType, typeDf in mapboxDf.groupby(["type"]):
         mapId = "mapbox_" + markerType
         ax.scatter(typeDf["markers"], typeDf["time"], label=mapId, color=colorLookup.get(mapId))
@@ -66,12 +69,12 @@ def mapboxTypes(df, plotTitle="mapbox.png"):
         typeAvgDf = typeDf.groupby(["markers"]).mean().reset_index()
         ax.plot(typeAvgDf["markers"], typeAvgDf["time"], color=colorLookup.get(mapId))
 
-    ax.legend(title="Marker Type")
-    ax.set_xlabel("Number of Markers", fontsize=15)
-    ax.set_ylabel("Time (ms)", fontsize=15)
-    ax.set_title("Mapbox: Markers and Features", fontsize=20)
+    ax.legend(title="Marker Type", fontsize=17, title_fontsize=20)
+    ax.set_xlabel("Number of Markers", fontsize=20)
+    ax.set_ylabel("Time (ms)", fontsize=20)
+    ax.set_title("Mapbox: Markers and Features", fontsize=25)
     folder = os.path.dirname(os.path.abspath(__file__)) + "/plots/"
-    plt.savefig(folder + plotTitle)
+    plt.savefig(folder + plotTitle, bbox_inches="tight")
 
 
 def smallValues(df):