nlft_qsp.plot
¶
Helper functions to plot polynomials using matplotlib.
Functions:
| Name | Description |
|---|---|
plot_chebyshev |
Plots the real part of each object in funcs over the interval \([-1, 1]\). |
plot_fourier |
Plots the absolute value of each object in funcs over the unit circle, i.e., plugging \(z = e^{it}\) for \(t \in [-\pi, \pi]\). |
plot_support_2d |
Plots where the given objects have non-zero elements (up to machine threshold) in rng. |
plot_chebyshev(funcs: dict, num_points: int = 1000)
¶
Plots the real part of each object in funcs over the interval \([-1, 1]\).
These can be Python functions, Polynomial objects, ChebyshevTExpansion objects, or
any callable object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
funcs
|
dict
|
a dictionary where each key is the name appearing in the legend of the corresponding function plot. |
required |
num_points
|
int
|
number of sampling points. |
1000
|
Source code in nlft_qsp/plot.py
plot_fourier(funcs: dict, num_points: int = 1000)
¶
Plots the absolute value of each object in funcs over the unit circle, i.e., plugging \(z = e^{it}\) for \(t \in [-\pi, \pi]\).
These can be Python functions, Polynomial objects, or any callable object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
funcs
|
dict
|
a dictionary where each key is the name appearing in the legend of the corresponding function plot. |
required |
num_points
|
int
|
number of sampling points. |
1000
|
Source code in nlft_qsp/plot.py
plot_support_2d(l: list, rng: tuple[range])
¶
Plots where the given objects have non-zero elements (up to machine threshold) in rng.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l
|
list
|
A list of objects that support subscript operation. |
required |
rng
|
tuple[range]
|
A 2D tuple of ranges defining the rectangle in the \(\Z^2\) grid to plot. |
required |