diff --git a/Images/Individual_Plots/plot_SecGuardID_1.png b/Images/Individual_Plots/plot_SecGuardID_1.png index b604d22..80b9c4d 100644 Binary files a/Images/Individual_Plots/plot_SecGuardID_1.png and b/Images/Individual_Plots/plot_SecGuardID_1.png differ diff --git a/Images/Individual_Plots/plot_SecGuardID_2.png b/Images/Individual_Plots/plot_SecGuardID_2.png deleted file mode 100644 index b604d22..0000000 Binary files a/Images/Individual_Plots/plot_SecGuardID_2.png and /dev/null differ diff --git a/Images/plot_SecGuardID_1.png b/Images/plot_SecGuardID_1.png deleted file mode 100644 index 745f388..0000000 Binary files a/Images/plot_SecGuardID_1.png and /dev/null differ diff --git a/Images/plot_SecGuardID_2.png b/Images/plot_SecGuardID_2.png deleted file mode 100644 index 0f02557..0000000 Binary files a/Images/plot_SecGuardID_2.png and /dev/null differ diff --git a/python/seer2.py b/python/seer2.py index 7fb858c..61947ff 100644 --- a/python/seer2.py +++ b/python/seer2.py @@ -95,17 +95,28 @@ def image_spoof(self, tile): # Add the spoofed OSM image to the map with the specified zoom level ax1.add_image(osm_img, int(scale + 1)) + + # Define a colormap based on the number of unique floors + floor_colormap = plt.cm.get_cmap('viridis', len(secguard_df['Floor'].unique())) + for index in range(0, len(secguard_df['Longitude']), 5): + floor_color = floor_colormap(secguard_df['Floor'].iloc[index] / len(secguard_df['Floor'].unique())) ax1.plot(secguard_df['Longitude'].iloc[index], secguard_df['Latitude'].iloc[index], markersize=10, - marker='o', linestyle='', color='Black', transform=ccrs.PlateCarree(), label='GPS Point') # plot points + marker='o', linestyle='', color=floor_color, transform=ccrs.PlateCarree(), label='GPS Point') + + plt.pause(1) + + + # Create a legend + handles = [] + labels = [] - annotation_text = f'Alt: {secguard_df["Altitude"].iloc[index]:.2f} meters\nFloor: {secguard_df["Floor"].iloc[index]}' - ax1.text(secguard_df['Longitude'].iloc[index], secguard_df['Latitude'].iloc[index], annotation_text, - fontsize=10, color='red', transform=ccrs.PlateCarree(), ha='right', va='bottom') + for floor in secguard_df['Floor'].unique(): + floor_color = floor_colormap(floor / len(secguard_df['Floor'].unique())) + handles.append(plt.Line2D([0], [0], marker='o', color=floor_color, label=f'Floor {floor}', markersize=10, markerfacecolor=floor_color)) - plt.pause(0.1) - else: - print(f"Error: No data for SecGuardID {secguard}") + labels.append('Floors') + ax1.legend(handles=handles, labels=labels, loc='upper left', bbox_to_anchor=(1, 1), title='Legend', fontsize=10) # Save individual plots plt.savefig(f'{individual_plots_directory}/plot_SecGuardID_{secguard}.png')