numerical_function_spaces.orlicz_spaces.plots
Functions
|
Saves the current figure in different formats (PNG, SVG, PDF) with a given name and p_norm. |
|
Set description for plots |
|
Plot the p-norms of a given signal x for a range of p values. |
|
Plot kappa() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder. |
|
Plot Orlicz_function, right side derivative and conjugate function on one plot |
|
Plot Orlicz_function, right side derivative and conjugate function on one plot |
|
Calculate domain and values of alpha() function. |
|
Plot kappa() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder. |
|
Calculate domain and values of tau() function. |
|
Plot tau() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder. |
Module Contents
- numerical_function_spaces.orlicz_spaces.plots.plot_save(name: str = 'plot', p_norm: float = '')[source]
Saves the current figure in different formats (PNG, SVG, PDF) with a given name and p_norm.
- Parameters:
name (str) – The name to be used for the saved files. Default is ‘plot’.
p_norm (float) – The p-norm value to be included in the file names. Default is an empty string.
- Returns:
The function saves the figure in folder ‘plots’
- Return type:
None
- numerical_function_spaces.orlicz_spaces.plots.description_for_plot(p_norm: float)[source]
Set description for plots
- Parameters:
p_norm (float) – The p-norm value to be included in plot description
- numerical_function_spaces.orlicz_spaces.plots.plot_p_norms(Orlicz_function, x, p_min=1, p_max=50, dp=2, attach_inf=False, show_progress=False, figsize: tuple = (5, 4), show: bool = False, save: bool = False)[source]
Plot the p-norms of a given signal x for a range of p values.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
x (np.ndarray) – A 2D numpy array representing x(t).
p_min (float greater or equal 1) – The minimum value of the p domain. Default is 1.
p_max (float smaller than infinity) – The maximum value of the p domain. Default is 50.
dp (positive float) – The step of the p domain. Default is 2.
attach_inf (bool) – Whether to attach infinity norm to the plot. Default is False.
show_progress (bool) – Whether to show a progress bar during computation. Default is False.
figsize (tuple) – The size of the plot. Default is (5, 4).
show (bool) – Whether to show the plot. Default is False.
save (bool) – Whether to save the plot in different formats (PNG, SVG, PDF) in the ‘plots’ folder. Default is False.
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure
- numerical_function_spaces.orlicz_spaces.plots.plot_kappa(Orlicz_function, x: numpy.ndarray, p_norm: float, k_min: float = 0.01, k_max: float = 10, dk: float = None, len_domain_k: int = 1000, show_progress: bool = False, figsize: tuple = (5, 4), show: bool = False, save: bool = False, save_name: str = None, title: str = None)[source]
Plot kappa() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
x (np.ndarray) – A 2D numpy array representing x(t).
k_min (float, optional) – The minimum value of the k domain in decimal form, by default 0.01.
k_max (float, optional) – The maximum value of the k domain in decimal form, by default 10.
dk (float, optional) – Step of k_domain, by default None When given, more important than len_domain_k
len_domain_k (int, optional) – The number of points in the k domain, by default 1000.
show_progress (bool, optional) – Whether to show a progress bar during computation, by default False.
figsize (tuple, optional) – Size of plots, by default (5,4)
show (bool, optional) – Whether to show plot, by default False.
save (bool, optional) – Whether to save plot in pdf, png, svg formats in plots folder, by default False.
save_name (string, optional) – Name for saved plots, by default ‘kappa_{p_norm}.pdf’
title (string, optional) – Title for plots, by default ‘kappa_{p,x}(k)’
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure
- numerical_function_spaces.orlicz_spaces.plots.plot_Phi_p_plus_Psi(Orlicz_function, u_max: float, du: float, max_u_on_plots: float, p_plus: numpy.ndarray = None, Psi: numpy.ndarray = None, figsize: tuple = (9, 3), show: bool = False, save: bool = False)[source]
Plot Orlicz_function, right side derivative and conjugate function on one plot and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz function
u_max (float) – Right limit of u_domain for Orlicz function (bigger u_max may improve Psi accuracy)
max_u_on_plots (float) – May be the same or smaller to u_max
p_plus (np.ndarray, optional (if given must use the same u_max and du as given for plot)) – A 1D numpy array representing right side derivative p_{+}(u)
Psi (np.ndarray, optional (if given must use the same u_max and du as given for plot)) – A 1D numpy array representing right conjugate function Psi(u)
figsize (tuple, optional) – Size of plots, by default (5,4)
show (bool, optional) – Whether to show plot, by default False.
save (bool, optional) – Whether to save plot in pdf, png, svg formats in plots folder, by default False.
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure
- numerical_function_spaces.orlicz_spaces.plots.plot_Phi(Orlicz_function, u_max: float, du: float, figsize: tuple = (5, 4), show: bool = False, save: bool = False)[source]
Plot Orlicz_function, right side derivative and conjugate function on one plot and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz function
u_max (float) – Right limit of u_domain for Orlicz function
figsize (tuple, optional) – Size of plots, by default (5,4)
show (bool, optional) – Whether to show plot, by default False.
save (bool, optional) – Whether to save plot in pdf, png, svg formats in plots folder, by default False.
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure
- numerical_function_spaces.orlicz_spaces.plots.array_for_alpha(Orlicz_function, du: float, u_max: float, x: numpy.ndarray, p_norm: float, p_plus: numpy.ndarray = None, Psi: numpy.ndarray = None, k_min: float = 0.01, k_max: float = 100, dk: float = None, len_domain_k: int = 1000, show_progress: bool = False)[source]
Calculate domain and values of alpha() function.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz, p_plus and Psi function
u_max (float) – Right limit of u_domain for Orlicz function
x (np.ndarray) – A 2D numpy array representing x(t).
p_norm (float) – The p-norm to be calculated.
p_plus (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right side derivative p_{+}(u)
Psi (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right conjugate function Psi(u)
k_min (float, optional) – The minimum value of the k domain in decimal form, by default 0.01.
k_max (float, optional) – The maximum value of the k domain in decimal form, by default 10.
dk (float, optional) – Step of k_domain, by default None When given, more important than len_domain_k
len_domain_k (int, optional) – The number of points in the k domain, by default 1000.
show_progress (bool, optional) – Whether to show a progress bar during computation, by default False.
- Return type:
Two numpy arrays, first for alpha domain, second for alpha values.
- numerical_function_spaces.orlicz_spaces.plots.plot_alpha(Orlicz_function, du: float, u_max: float, x: numpy.ndarray, p_norm: float, p_plus: numpy.ndarray = None, Psi: numpy.ndarray = None, k_min: float = 0.01, k_max: float = 100, dk: float = None, len_domain_k: int = 1000, show: bool = False, save: bool = False, show_progress: bool = False, save_name: str = None, title: str = None, figsize: tuple = (5, 4))[source]
Plot kappa() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz, p_plus and Psi function
u_max (float) – Right limit of u_domain for Orlicz function
x (np.ndarray) – A 2D numpy array representing x(t).
p_norm (float) – The p-norm to be calculated.
p_plus (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right side derivative p_{+}(u)
Psi (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right conjugate function Psi(u)
k_min (float, optional) – The minimum value of the k domain in decimal form, by default 0.01.
k_max (float, optional) – The maximum value of the k domain in decimal form, by default 10.
dk (float, optional) – Step of k_domain, by default None When given, more important than len_domain_k
len_domain_k (int, optional) – The number of points in the k domain, by default 1000.
show_progress (bool, optional) – Whether to show a progress bar during computation, by default False.
figsize (tuple, optional) – Size of plots, by default (5, 4)
show (bool, optional) – Whether to show plot, by default False.
save (bool, optional) – Whether to save plot in pdf, png, svg formats in plots folder, by default False.
save_name (string, optional) – Name for saved plots, by default ‘kappa_{p_norm}.pdf’
title (string, optional) – Title for plots, by default ‘kappa_{p,x}(k)’
Note
In this function there are no warnings about exceeding k^{*} and k^{**} ranges
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure
- numerical_function_spaces.orlicz_spaces.plots.array_for_tau(Orlicz_function, du: float, u_max: float, x: numpy.ndarray, p_norm: float, p_plus: numpy.ndarray = None, Psi: numpy.ndarray = None, k_min: float = 0.01, k_max: float = 100, dk: float = None, len_domain_k: int = 1000, show_progress: bool = False)[source]
Calculate domain and values of tau() function.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz, p_plus and Psi function
u_max (float) – Right limit of u_domain for Orlicz function
x (np.ndarray) – A 2D numpy array representing x(t).
p_norm (float) – The p-norm to be calculated.
p_plus (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right side derivative p_{+}(u)
Psi (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right conjugate function Psi(u)
k_min (float, optional) – The minimum value of the k domain in decimal form, by default 0.01.
k_max (float, optional) – The maximum value of the k domain in decimal form, by default 10.
dk (float, optional) – Step of k_domain, by default None When given, more important than len_domain_k
len_domain_k (int, optional) – The number of points in the k domain, by default 1000.
show_progress (bool, optional) – Whether to show a progress bar during computation, by default False.
- Return type:
Two numpy arrays, first for tau domain, second for tau values.
- numerical_function_spaces.orlicz_spaces.plots.plot_tau(Orlicz_function, du: float, u_max: float, x: numpy.ndarray, p_norm: float, p_plus: numpy.ndarray = None, Psi: numpy.ndarray = None, k_min: float = 0.01, k_max: float = 100, dk: float = None, len_domain_k: int = 1000, show: bool = False, save: bool = False, show_progress: bool = False, save_name: str = None, title: str = None, figsize: tuple = (5, 4))[source]
Plot tau() function and (optionally) save the current figure in different formats (PNG, SVG, PDF) in plots folder.
- Parameters:
Orlicz_function (function) – The Orlicz function to be used in form accepting decimal numbers
du (float) – Step of u_domain for Orlicz, p_plus and Psi function
u_max (float) – Right limit of u_domain for Orlicz function
x (np.ndarray) – A 2D numpy array representing x(t).
p_norm (float) – The p-norm to be calculated.
p_plus (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right side derivative p_{+}(u)
Psi (np.ndarray, optional (must use the same u_max and du as given for plot), by default None) – A 1D numpy array representing right conjugate function Psi(u)
k_min (float, optional) – The minimum value of the k domain in decimal form, by default 0.01.
k_max (float, optional) – The maximum value of the k domain in decimal form, by default 10.
dk (float, optional) – Step of k_domain, by default None When given, more important than len_domain_k
len_domain_k (int, optional) – The number of points in the k domain, by default 1000.
show_progress (bool, optional) – Whether to show a progress bar during computation, by default False.
figsize (tuple, optional) – Size of plots, by default (5, 4)
show (bool, optional) – Whether to show plot, by default False.
save (bool, optional) – Whether to save plot in pdf, png, svg formats in plots folder, by default False.
save_name (string, optional) – Name for saved plots, by default ‘kappa_{p_norm}.pdf’
title (string, optional) – Title for plots, by default ‘kappa_{p,x}(k)’
Note
In this function there are no warnings about exceeding k^{*} and k^{**} ranges
- Returns:
The function generates a figure and (optionally) save in folder ‘plots’
- Return type:
Matplotlib figure