瀏覽代碼

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):