@@ -204,7 +204,7 @@ def plot_map(self, axis1=None, output=None, save_as='resultMap.png'):
204204 axis1 .set_xlabel ('Longitude' )
205205 axis1 .set_ylabel ('Latitude' )
206206 axis1 .set_xticks (np .linspace (0 ,int (self .width_meters ),num = 8 ))
207- axis1 .set_xticklabels (self .x_ticks )
207+ axis1 .set_xticklabels (self .x_ticks , rotation = 30 , ha = 'center' )
208208 axis1 .set_yticks (np .linspace (0 ,int (self .height_meters ),num = 8 ))
209209 axis1 .set_yticklabels (self .y_ticks )
210210 axis1 .grid ()
@@ -324,10 +324,10 @@ def get_ticks(self):
324324 :return:
325325 """
326326 self .x_ticks = map (
327- lambda x : round (x , 6 ),
327+ lambda x : round (x , 4 ),
328328 np .linspace (self .bounds [1 ], self .bounds [3 ], num = 8 ))
329329 self .y_ticks = map (
330- lambda x : round (x , 6 ),
330+ lambda x : round (x , 4 ),
331331 np .linspace (self .bounds [2 ], self .bounds [0 ], num = 8 ))
332332 # Ticks must be reversed because the orientation of the image in the matplotlib.
333333 # image - (0, 0) in upper left corner; coordinate system - (0, 0) in lower left corner
@@ -490,7 +490,7 @@ def live_plot(self, env, time_step=None, fig=None, ax=None, data=None):
490490 lines .extend ([line5 ])
491491
492492 # Legend
493- ax .legend (handles = lines , loc = 'upper center ' , bbox_to_anchor = (0.5 , - 0.05 ), fancybox = True , shadow = True ,ncol = 2 )
493+ ax .legend (handles = lines , loc = 'upper left ' , bbox_to_anchor = (1.04 , 1.0 ), fancybox = True , shadow = True , ncol = 1 )
494494
495495 # X/Y Limits
496496 if self .openstreetmap is None :
@@ -502,17 +502,20 @@ def live_plot(self, env, time_step=None, fig=None, ax=None, data=None):
502502
503503 # Sidebar Text
504504
505+ #actual_str = r'$\bf{Actual}$''\n' # prettier format but adds ~0.04 seconds ???
505506 actual_str = 'Actual\n '
506507 actual_str += 'Bearing = {:.0f} deg\n ' .format (data .get ('bearing' ,None )) if data .get ('bearing' , None ) else 'Bearing = unknown\n '
507508 actual_str += 'Speed = {:.2f} m/s' .format (data .get ('action_taken' , None )[1 ]) if data .get ('action_taken' , None ) else 'Speed = unknown\n '
508509
510+ #proposal_str = r'$\bf{Proposed}$''\n'
509511 proposal_str = 'Proposed\n '
510512 proposal_str += 'Bearing = {:.0f} deg\n ' .format (data .get ('action_proposal' , None )[0 ]) if all (data .get ('action_proposal' , None )) else 'Bearing = unknown\n '
511513 proposal_str += 'Speed = {:.2f} m/s' .format (data .get ('action_proposal' , None )[1 ]) if all (data .get ('action_proposal' , None )) else 'Speed = unknown\n '
512514
513515 last_mean_hyp = self .pf_stats ['mean_hypothesis' ][- 1 ][0 ]
514516 last_map_hyp = self .pf_stats ['map_hypothesis' ][- 1 ][0 ]
515517
518+ #rssi_str = r'$\bf{RSSI}$''\n'
516519 rssi_str = 'RSSI\n '
517520 rssi_str += 'Observed = {:.1f} dB\n ' .format (env .last_observation ) if env .last_observation else 'Observed = unknown\n '
518521 rssi_str += 'Expected = {:.1f} dB\n ' .format (self .expected_target_rssi ) if self .expected_target_rssi else 'Expected = unknown\n '
0 commit comments