graphics module
The eigval_tsa.graphics module contains basic functions to plot the results of an eigenvalue estimation with the module eigval_tsa.param_opt and eigval_tsa.analysis toolkits. The functions
abs_max_eigval_plot(...)
prep_plot_imaginary_plane(eigvals)
max_eigval_gauss_plot(...)
are explained in the following.
- antiCPy.early_warnings.dominant_eigenvalue.graphics.abs_max_eigval_plot(ev_1=[], time_1=[], data_1=[], cl_1=['', 'b'], ev_2=[], time_2=[], data_2=[], cl_2=['', 'g'], ev_3=[], time_3=[], data_3=[], cl_3=['', 'r'], ev_4=[], time_4=[], data_4=[], cl_4=['', 'k'], ev_5=[], time_5=[], data_5=[], cl_5=['', 'm'], ev_6=[], time_6=[], data_6=[], cl_6=['', 'c'], ws_1=100, ws_2=100, ws_3=100, ws_4=100, ws_5=100, ws_6=100, label_1='', label_2='', label_3='', label_4='', label_5='', label_6='', ls_1='b-', ls_2='g-', ls_3='r-', ls_4='k-', ls_5='m-', ls_6='c-', axis=[0, 100, -1.1, 1.1], integrated_plot=False, save=False, save_name='default00.png', show=True)[source]
- Parameters:
ev_1 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_1 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_1 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_1 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ev_2 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_2 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_2 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_2 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ev_3 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_3 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_3 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_3 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ev_4 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_4 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_4 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_4 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ev_5 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_5 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_5 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_5 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ev_6 (One dimensional numpy array of floats.) – A one dimensional numpy array containing an estimated absolute eigenvalue time series.
time_6 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the the time sampling of the investigated time series of which one has estimated the eigenvalues.
data_6 (One dimensional numpy array of floats.) – A one dimensional numpy array containing the time series of which one has estimated the eigenvalues.
cl_6 (One dimensional string array with two entries.) – A one dimensional string array with two entries. The first contains the time at which a critical transition shall be marked with a dotted vertical critical line. If it is empty as by default, no line is plotted. The second entry is a string with the color options of the line.
ws_1 (Integer.) – An integer number that indicates the rolling window size of the first set of ev_1, time_1 and data_1.
ws_2 (Integer.) – An integer number that indicates the rolling window size of the second set of ev_2, time_2 and data_2.
ws_3 (Integer.) – An integer number that indicates the rolling window size of the third set of ev_3, time_3 and data_3.
ws_4 (Integer.) – An integer number that indicates the rolling window size of the fourth set of ev_4, time_4 and data_4.
ws_5 (Integer.) – An integer number that indicates the rolling window size of the fifth set of ev_5, time_5 and data_5.
ws_6 (Integer.) – An integer number that indicates the rolling window size of the sixth set of ev_6, time_6 and data_6.
ls_1 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 1 is by default ‘b-‘.ls_2 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 2 is by default ‘g-‘.ls_3 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 3 is by default ‘r-‘.ls_4 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 4 is by default ‘k-‘.ls_5 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 5 is by default ‘m-‘.ls_6 (String with the specific linestyle encoding of
matplotlib.plot.) – The line style of dataset 6 is by default ‘c-‘.label_1 (String.) – A string with the label for the ev_1.
label_2 (String.) – A string with the label for the ev_2.
label_3 (String.) – A string with the label for the ev_3.
label_4 (String.) – A string with the label for the ev_4.
label_5 (String.) – A string with the label for the ev_5.
label_6 (String.) – A string with the label for the ev_6.
axis (A one dimensional array with four float entries.) – A one dimensional array with four limiting entries for the x and y axis of the plot. The first two entries are the lower and upper x limit, the last two entries are the lower and upper y limit. The array is [0,100,-1.1,1.1] by default.
integrated_plot (Boolean.) – If the boolean is
True, two plots are generated in a window. The upper one shows the eigenvalue time series, the lower one shows the investigated dataset. If the boolean isFalse, just the upper plot is generated.save (Boolean.) – If the boolean is
True, the plot is saved under the name ofsave_name.save_name (String.) – The string is ‘default00.png’ by default.
show (Boolean.) – If the boolean is
True, the plot is shown. Otherwise it is not.
- Returns:
The function generates a plot with the desired features. Depending on the input the function shows and saves the plot.
- antiCPy.early_warnings.dominant_eigenvalue.graphics.prep_plot_imaginary_plane(eigvals)[source]
- Parameters:
eigvals (Two dimensional numpy array of complex floats.) – A two dimensional numpy array that contains all estimated eigenvalues for a specific rolling window in a row. Each following row corresponds to the eigenvalues in the next rolling window.
- Returns:
The function returns a one dimensional numpy array of the eigenvalues of each rolling window that have maximum absolute value in each rolling time window. In the case of complex conjugated eigenvalues both eigenvalues are appended to the output.
- Return type:
One dimensional numpy array of complex float numbers.
- antiCPy.early_warnings.dominant_eigenvalue.graphics.max_eigval_gauss_plot(ev_1=[], ev_2=[], ev_3=[], label_1='', label_2='', label_3='', cmap_1='Blues', cmap_2='Greens', cmap_3='Reds', title='', save=False, save_name='gaussian_default00.png', show=True)[source]
- Parameters:
ev_1 (One dimensional numpy array of complex floats.) – A one dimensional numpy array containing the maximum estimated eigenvalues of each rolling time window that are eventually obtained and sorted by
eigval_tsa.graphics.prep_plot_imaginary_plane.ev_2 (One dimensional numpy array of complex floats.) – A one dimensional numpy array containing the maximum estimated eigenvalues of each rolling time window that are eventually obtained and sorted by
eigval_tsa.graphics.prep_plot_imaginary_plane.ev_3 (One dimensional numpy array of complex floats.) – A one dimensional numpy array containing the maximum estimated eigenvalues of each rolling time window that are eventually obtained and sorted by
eigval_tsa.graphics.prep_plot_imaginary_plane.label_1 (String.) – String with the legend name of ev_1.
label_2 (String.) – String with the legend name of ev_2.
label_3 (String.) – String with the legend name of ev_3.
cmap_1 (String with the specific encoding of colour maps in
matplotlib.scatterwithColormapfrommatplotlib.colors.) – The colour map to illustrate the time evolution in the Gaussian plane for the ev_1 is by default the string ‘Blues’.cmap_2 (String with the specific encoding of colour maps in
matplotlib.scatterwithColormapfrommatplotlib.colors.) – The colour map to illustrate the time evolution in the Gaussian plane for the ev_2 is by default the string ‘Greens’.cmap_3 (String with the specific encoding of colour maps in
matplotlib.scatterwithColormapfrommatplotlib.colors.) – The colour map to illustrate the time evolution in the Gaussian plane for the ev_3 is by default the string ‘Reds’.title – String with the plot’s title. Default is empty.
save (Boolean.) – The Boolean is
Falseby default. If it isTrue, the plot is saved with the name of the string save_name.save_name (String.) – String name of the saved plot. It is ‘gaussian_default00.png’ by default.
show (Boolean.) – The Boolean is
Trueby default and the generated plot is shown. Otherwise it will not be shown.
- Returns:
The function generates a time resolved plot of the eigenvalues in the Gaussian plane which have maximum absolute value. It can be shown and saved as required.
- antiCPy.early_warnings.dominant_eigenvalue.graphics.plot_fnn(data, extent=[0.5, 15.5, 14.5, 50.5], title='false next neighbours', save=False, save_name='fnn_default00.png', R_threshold_series=True, R_threshold='undefined', start_order=1, end_order=15)[source]
- Parameters:
data (One or two dimensional float numpy array.) – A one dimensional float numpy array with the results of the false nearest neighbour algorithm for a fixed threshold as it can be obtained with
eigval_tsa.param_opt.false_NNor a two dimensional float numpy array with the results of the false next neighbour algorithm for various thresholds as it can be obtained witheigval_tsa.param_opt.various_R_threshold_fnn.extent (One dimensional float array with four entries.) – A one dimensional array with the x and y limits of the colour map. The 0.5 offset is for a centered position of the ticks.
title (String.) – The string defines the title of the plot.
save (Boolean.) – If save is set to
True, the figure is saved. The default isFalse.save_name (String.) – The string defines the name of the saved figure.
R_threshold_series (Boolean.) – This Boolean defines whether the data of which a plot shall be created is a two dimensional array of a threshold series or a one dimensional array for a fixed threshold.
R_threshold (String.) – This string defines the fixed threshold for a one dimensional time series.
start_order (Integer.) – Defines the low limit dimension that is evaluated with the false next neighbour algorithm.
end_order (Integer.) – Defines the upper limit dimension that is evaluated with the false next neighbour algorithm.
- Returns:
The result is a visualisation of the false next neighbour results with the desired title. It is possible to save the result.
- antiCPy.early_warnings.dominant_eigenvalue.graphics.plot_avg_DD(data, start_lag=1, end_lag=10, lag_sampling=1, label='undefined', lag_unit='sampling step', show_legend=True, title='avg distance from diagonal', save=False, save_name='avg_DD_default00.png')[source]
- Parameters:
data (A one dimensional numpy array of floats.) – A one dimensional float numpy array with the results of the function
eigval_tsa.param_opt.avg_distance_from_diagonal.start_lag (Float.) – The first time lag that was evaluated with teh average distance from diagonal algorithm.
end_lag (Float.) – The last time lag that was evaluated with teh average distance from diagonal algorithm.
lag_sampling (Float.) – The sampling of the time delays that are evaluated with the average distance from diagonal algorithm.
label (String.) – A string to define a name in the legend for the data results.
lag_unit (String.) – A string that defines the units of the x-axis time lag :math:` au`.
show_legend (Boolean.) – If
True, the legend is shown. Otherwise not. Default isshow_legend = True.title (String.) – A string to set the title of the figure.
save (Boolean.) – If save is
Falseas set by default, the image is not saved. Otherwise the image will be saved with the name defined by the stringsave_name.save_name (String.) – A string that contains the name to save the plotted figure if
save = True.
- Returns:
Plot of a figure with the results of the average distance from diagonal algorithm. The design is partly possible to choose and the figure can be optionally saved.