polynomials_on_simplices.calculus.plot_function module¶
Plotting of analytic expressions (in the form of callables).
-
evaluate_curve
(gamma, t)[source]¶ Evaluate a parametric curve in 2d (\(\gamma(t) = (\gamma_1(t), \gamma_2(t))\)) or 3d (\(\gamma(t) = (\gamma_1(t), \gamma_2(t), \gamma_3(t))\)) at a number of locations.
Parameters: - gamma (Callable \(\gamma(t)\)) – Parametric curve (vector valued (2d or 3d) univariate function).
- t – Positions where the curve should be evaluated (array of floats).
Returns: Array of curve values, one for each location in the input t array.
-
plot_bivariate_function
(f, tri_vertices, *args, **kwargs)[source]¶ Plot a bivariate function on a triangular domain.
Parameters: - f (Callable f(x, y)) – Bivariate function to plot (bivariate real-valued function).
- tri_vertices – Vertices of the triangular domain (3 by 2 matrix where each row is a vertex in the triangle).
- args – Additional arguments passed to the
plot_triangle_mesh()
command. - kwargs – ‘edge_resolution’: Number of discrete points in the plot along each edge in the triangle mesh.
Further keyword arguments are passed to the
plot_triangle_mesh()
command.
-
plot_curve
(gamma, t_start=0.0, t_stop=1.0, *args, **kwargs)[source]¶ Plot a parametric curve in 2d (\(\gamma(t) = (\gamma_1(t), \gamma_2(t))\)) or 3d (\(\gamma(t) = (\gamma_1(t), \gamma_2(t), \gamma_3(t))\)).
Parameters: - gamma (Callable \(\gamma(t)\)) – Parametric curve (vector valued (2d or 3d) univariate function).
- t_start (float) – Beginning of range to plot for the curve parameter t.
- t_stop (float) – End of range to plot for the curve parameter t.
- args – Additional arguments passed to the
plot_curve()
command. - kwargs – Keyword arguments. ‘num’: Number of discrete points in the plot. Further keyword arguments are
passed to the
plot_curve()
command.
-
plot_function
(f, x_start=0.0, x_stop=1.0, *args, **kwargs)[source]¶ Plot a univariate function.
Parameters: - f (Callable f(x)) – Function expression to plot (univariate real-valued function).
- x_start (float) – Beginning of x-range to plot.
- x_stop (float) – End of x-range to plot.
- args – Additional arguments passed to the
plot_curve()
command. - kwargs – Keyword arguments passed to the
plot_curve()
command.