argopy.plot.plot_trajectory#
- plot_trajectory(df: DataFrame, style: str = 'whitegrid', add_legend: bool = True, palette: str = 'Set1', set_global: bool = False, with_cartopy: bool = False, with_seaborn: bool = False, **kwargs)[source]#
Plot trajectories for an Argo index dataframe
This function is called by the Data and Index fetchers method ‘plot’ with the ‘trajectory’ option:
from argopy import DataFetcher, IndexFetcher obj = IndexFetcher().float([6902766, 6902772, 6902914, 6902746]) # OR obj = DataFetcher().float([6902766, 6902772, 6902914, 6902746]) fig, ax = obj.plot('trajectory')
- Parameters:
df (
pandas.DataFrame
) – Input data with columns: ‘wmo’, ‘longitude’, ‘latitude’.style (str) – Define the Seaborn axes style: ‘white’, ‘darkgrid’, ‘whitegrid’, ‘dark’, ‘ticks’.
add_legend (bool, default=True) – Add a box legend with list of floats. True by default for a maximum of 15 floats, otherwise no legend.
palette (str) – Define colors to be used for floats: ‘Set1’ (default) or any other matplotlib colormap or name of a Seaborn palette (deep, muted, bright, pastel, dark, colorblind).
set_global (bool, default=False) – Plot trajectories on a global world map or not.
- Returns:
fig (
matplotlib.figure.Figure
)ax (
matplotlib.axes.Axes
)
Warning
This function will produce a plot even if Cartopy is not installed. If Cartopy is found, then this function will call
argopy.plot.scatter_map
.