The plot initially has descending depth on y-axis and ascending variable (e.g., Temperature) on x-axis with each line representing a unique CTD cast across each depth recorded. If the plot is interactive, then on hover the CTD cast (uniquely identified by cast_count) is highlighted in red and others dimmed in gray.

plot_depth(df, variable = "Temperature", interactive = TRUE)

Arguments

df

data frame with columns: cast_count, depth_m, v

variable

variable (character), should be one of plot_title from get_variables(); default: "Temperature"

interactive

whether to render interactive plot; default: TRUE

Value

interactive plot of type plotly::ggplotly() or static plot of type ggplot2::ggplot().

Examples

# plot depth with the station data
plot_depth(df = bottle_temp_depth, variable = "Temperature")
#> Warning: `get_variables()` was deprecated in calcofi4r 1.1.0.
#>  Please use `cc_list_measurement_types()` instead.
#>  The CalCOFI API is being phased out. Use DuckDB access via cc_get_db()
#>   instead.
#>  The deprecated feature was likely used in the calcofi4r package.
#>   Please report the issue at <https://github.com/calcofi/calcofi4r/issues>.
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#>  Please use `linewidth` instead.
#>  The deprecated feature was likely used in the calcofi4r package.
#>   Please report the issue at <https://github.com/calcofi/calcofi4r/issues>.