@@ -500,9 +500,6 @@ def overlay_measurements(
500
500
if not isinstance (dfs , list ):
501
501
dfs = [dfs ]
502
502
503
- if fig is None :
504
- fig = go .Figure ()
505
-
506
503
color_values = list (colors .values ())
507
504
508
505
station_colors = {}
@@ -754,18 +751,16 @@ def plot_residual_histogram(
754
751
755
752
def plot_measurements (
756
753
df ,
757
- msr_type ,
754
+ msr_type = None ,
758
755
title = None ,
759
756
time_col_name = "Epoch:Gregorian UTC" ,
760
757
html_out = None ,
761
758
copyright = None ,
762
759
show = True ,
763
760
):
764
761
"""
765
- Plot the provided measurement type, fuzzy matching of the column name
762
+ Plot the provided measurement type, fuzzy matching of the column name, or plot all as a strip
766
763
"""
767
-
768
- msr_col_name = [col for col in df .columns if msr_type in col .lower ()]
769
764
770
765
if title is None :
771
766
# Build a title
@@ -796,9 +791,14 @@ def plot_measurements(
796
791
df ["time_col" ] = pd .Series (pd_ok_epochs )
797
792
x_title = "Epoch {}" .format (time_col_name [- 3 :])
798
793
799
- fig = px .scatter (df , x = "time_col" , y = msr_col_name , color = "Tracking device" )
794
+ if msr_type is None :
795
+ fig = px .strip (df , x = "time_col" , y = "Tracking device" , color = "Tracking device" )
796
+ finalize_plot (fig , title , x_title , "All tracking data" , copyright )
797
+ else :
798
+ msr_col_name = [col for col in df .columns if msr_type in col .lower ()]
800
799
801
- finalize_plot (fig , title , x_title , msr_col_name [0 ], copyright )
800
+ fig = px .scatter (df , x = "time_col" , y = msr_col_name , color = "Tracking device" )
801
+ finalize_plot (fig , title , x_title , msr_col_name [0 ], copyright )
802
802
803
803
if html_out :
804
804
with open (html_out , "w" ) as f :
@@ -809,7 +809,3 @@ def plot_measurements(
809
809
fig .show ()
810
810
else :
811
811
return fig
812
-
813
- if __name__ == "__main__" :
814
- df = pd .read_parquet ("output_data/msr-2023-11-25T06-14-01.parquet" )
815
- plot_measurements (df , "range" )
0 commit comments