diff --git a/docs/examples/plotting/Polar_Plotting.py b/docs/examples/plotting/Polar_Plotting.py index bc0d6d222..46517e31f 100644 --- a/docs/examples/plotting/Polar_Plotting.py +++ b/docs/examples/plotting/Polar_Plotting.py @@ -1,14 +1,14 @@ """ Polar Plotting Example -======================== +====================== This example demonstrates use of the :class:`~.PolarPlotterly` plotting class. :class:`~.PolarPlotterly` uses :func:`plotly.graph_objects.Scatterpolar` to plot ground truths, detections, and tracks in a polar plotter. -In this example, two airborne platforms are generated in a Cartesian state space. A -:class:`~.RadarBearingRange` sensor is used to convert the Cartesian state space to an -angular one. Angular ground truth is created using measurements without noise. Detections -(with noise) are also generated. Both detections and ground truth are plotted in a polar plot. +In this example, two platforms are generated in a Cartesian state space. A +:class:`~.RadarBearingRange` sensor is used to convert the Cartesian state space to an angular one. +Angular ground truth is created using measurements without noise. Detections (with noise) are also +generated. Both detections and ground truth are plotted in a polar plot. """ # %% @@ -36,7 +36,7 @@ # ----------------------------------- # Two targets are created: # #. Target 1 moves in a ā€˜Cā€™ shape. First it moves west (negative x), then it starts a slow, -# long 180-degree turn moving south, until it is moving east (positive x). +# long 180-degree turn anti-clockwise, until it is moving east (positive x). # #. Target 2 moves in a straight line from north to south. # Create manoeuvre behaviours and durations for our moving platform @@ -91,9 +91,9 @@ # %% # Generate Angular State Space Data -# ---------------------------------- -# Measure the previously generated cartesian state space using a -# :class:`~.RadarBearingRange` sensor: +# --------------------------------- +# Angular state space data is generated by measuring the previously generated Cartesian state +# space with a :class:`~.RadarBearingRange` sensor: # %% # Create sensor: @@ -121,13 +121,13 @@ detections.extend(sensor.measure({target_1[t], target_2[t]}, noise=True)) # %% -# Time (s) vs Azimuth Angle (Radians) +# Azimuth Angle (Radians) vs Time (s) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mapping = [0] plotter_az_t_cart = Plotterly(dimension=1, - title="Cartesian - Time (s) vs Azimuth Angle (Radians)", + title="Cartesian - Azimuth Angle (Radians) vs Time (s)", xaxis=dict(title=dict(text="Time (seconds)")), - yaxis=dict(title=dict(text="Bearing (Radians)")) + yaxis=dict(title=dict(text="Azimuth Angle (Radians)")) ) plotter_az_t_cart.plot_ground_truths({angular_ground_truth_1}, mapping=mapping, label="Target 1") @@ -147,13 +147,13 @@ # Create Polar Plots # ------------------ # :class:`~.PolarPlotterly` inherits from :class:`~._Plotter` and therefore has all the same -# methods are the other plotters. +# methods as the other plotters. # %% # Azimuth Angle (Degrees) vs Time (s) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mapping = [0] -plotter_az_t = PolarPlotterly(title="Azimuth Angle (Degrees) vs Time (s)") +plotter_az_t = PolarPlotterly(title="Polar - Azimuth Angle (Degrees) vs Time (s)") plotter_az_t.plot_ground_truths({angular_ground_truth_1}, mapping=mapping, label="Target 1") plotter_az_t.plot_ground_truths({angular_ground_truth_2}, mapping=mapping, label="Target 2") plotter_az_t.plot_measurements(detections, mapping=mapping, convert_measurements=False) @@ -187,9 +187,9 @@ # %% -# Reference XY Plot -# ^^^^^^^^^^^^^^^^^ -# This is similar to the previous x/y plot but also contains the detections. +# Reference Cartesian Plot +# ^^^^^^^^^^^^^^^^^^^^^^^^ +# For comparison, this is the original Cartesian plot with the detections displayed plotter_xy.plot_measurements(detections, mapping=[0, 2]) plotter_xy.fig