maad.util.plot_features
- maad.util.plot_features(df, ax=None, norm=True, mode='24h', **kwargs)[source]
Plot the variation of features values (ie. indices) in the DataFrame obtained with
maad.features
.- Parameters:
- dfPanda DataFrame
DataFrame with features (ie. indices).
- normboolean, default is True
if True, the features are normalized by the max
- modestring in {‘24h’}, default is ‘24h’
- Select if the timeline of the phenology :
-‘24h’ : average of the results over a day - otherwise, the timeline is the timeline of the dataframe
- **kwargs
- figsizetuple of integers, optional, default: (4,10)
width, height in inches.
- figtitlestring, optional, default‘’
title of the figure
- xlabelstring, optional, default‘Time [s]’
label of the horizontal axis
- ylabelstring, optional, default‘Amplitude [AU]’
label of the vertical axis
- xtickstuple of ndarrays, optional, defaultnone
ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.
labels : array_like, optional => A list of explicit labels to place at the given locs.
- ytickstuple of ndarrays, optional, defaultnone
ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.
labels : array_like, optional => A list of explicit labels to place at the given locs.
- nowboolean, optional, defaultTrue
if True, display now. Cannot display multiple images. To display mutliple images, set now=False until the last call for the last image
… and more, see matplotlib
- Returns:
- figFigure
The Figure instance
- axAxis
The Axis instance
Examples
see plot_extract_alpha_indices.py advanced example for a complete example
>>> import numpy as np >>> import pandas as pd >>> np.random.seed(2021) >>> M = np.random.rand(24, 2) >>> df = pd.DataFrame(M) >>> indices = ['A','B'] >>> df.columns = indices >>> df.index =pd.date_range(start=pd.Timestamp('00:00:00'), end=pd.Timestamp('23:00:00'), freq='1H') >>> maad.util.plot_features(df)