API: ComplexViz

This reference is auto-generated from the source code on GitHub. For explanations and mathematical context, see Fundamentals and Learn.

from figuratenum.figurate_viz import ComplexViz

Phase portrait visualization of complex-valued generating functions of figurate numbers, based on Elias Wegert (2012).


Overview

Unified interface for evaluating and visualizing generating functions
of plane, space, and multidimensional figurate numbers, inspired by the style of Elias Wegert (2012).

References
----------
[1] Wegert, E. (2012). Visual Complex Functions: An Introduction
    with Phase Portraits. Birkhäuser Basel.
    https://doi.org/10.1007/978-3-0348-0180-5

Constructor

ComplexViz(
    resolution : int = 800,
    figsize : tuple[float, float] = (6, 6),
    plot_type : PlotType = 'enhanced_phase_portrait',
    cmap_color : str = 'hsv',
    brightness : float = 0.7,
    num_lines : int = 20,
    domain_grid_radius : float = 2.0,
    disk_radius : float | None = None,
    show_axes : bool = False,
)
Initialize a ComplexViz instance.

Default configuration for phase portrait visualization of
complex-valued generating functions of figurate numbers.

Defaults are used unless overridden per method call.

Parameters
----------
resolution : int, default=800
    Default resolution of the evaluation grid.
figsize : tuple[float, float], default=(6, 6)
    Figure size in inches (width, height)
plot_type : {'pure_phase_portrait', 'phase_contours', 'modulus_contours', 'enhanced_phase_portrait'}, default='enhanced_phase_portrait'
    Type of plot to generate:
    - 'pure_phase_portrait': phase coloring only
    - 'phase_contours': phase coloring with contour lines
    - 'modulus_contours': phase coloring with modulus contours
    - 'enhanced_phase_portrait': combines phase and modulus contours
cmap_color : str, default='hsv'
    Default colormap for phase coloring.
brightness : float, default=0.7
    Base brightness for contours (0-1).
num_lines : int, default=20
    Default number of contour lines for phase and modulus.
disk_radius : float | None, default=None
    Radius of the circular masking region centered at (0, 0).
    Values outside this radius are excluded (set to transparent).
    Must be strictly positive if provided.
domain_grid_radius : float, default=2.0
    Half-width of the square evaluation domain centered at the origin.
show_axes : bool, default=False
    If True, displays the real (Re) and imaginary (Im) axes.

Visualization Methods

visualize_plane

visualize_plane(
    name_seq : PlaneTypes,
    *,
    m : int | None = None,
    plot_type : PlotType | None = None,
    show : bool = True,
    **kwargs,
)
Visualize the generating function of a plane figurate number in the complex plane (phase portrait).

Parameters
----------
name_seq : PlaneTypes
    Plane figurate number sequence defining its generating function f(z).
m : int | None
    Parameter defining the m-gonal structure (if applicable).
plot_type : PlotType, optional
    Overrides the default plot type of the instance.
show : bool, default=True
    Whether to display the plot immediately. If False, the plot is generated but not shown.
**kwargs : dict
    Per-call plot options. Can override instance defaults:
    - xlim : tuple[float, float], optional
        Horizontal limits of the complex plane. Overrides `domain_grid_radius`.
    - ylim : tuple[float, float], optional
        Vertical limits of the complex plane. Overrides `domain_grid_radius`.
    - show_axes : bool, optional
        Whether to display the real (Re) and imaginary (Im) axes.
    - Instance defaults applied if not provided: figsize, cmap_color, brightness, num_lines, disk_radius.

Returns
-------
matplotlib.figure.Figure
    The generated figure. Automatically displayed if `show=True`.

Sequence Reference — PlaneTypes

The name_seq parameter accepts values from the table below. Each name identifies a figurate number sequence.

Pass to visualize_plane(name_seq=...).

name_seqname_seqname_seq
polygonaltriangularsquare
pentagonalhexagonalcentered_mgonal
pronicgnomonictruncated_triangular
truncated_squaretruncated_pronictruncated_centered_mgonal
truncated_centered_triangulartruncated_centered_squaretruncated_centered_pentagonal
truncated_centered_hexagonalpolygramaztec_diamond
crossdiamondgeneralized_mgonal
generalized_centered_mgonalgeneralized_pronicsquare_triangular
pentagonal_triangularpentagonal_squarehexagonal_square
hexagonal_pentagonalheptagonal_triangularheptagonal_square
heptagonal_pentagonalheptagonal_hexagonaloctagonal_triangular
octagonal_squareoctagonal_pentagonaloctagonal_hexagonal
octagonal_heptagonalnonagonal_triangularnonagonal_square
nonagonal_pentagonalnonagonal_hexagonalnonagonal_heptagonal
nonagonal_octagonal

visualize_space

visualize_space(
    name_seq : SpaceTypes,
    *,
    m : int | None = None,
    plot_type : PlotType | None = None,
    show : bool = True,
    **kwargs,
)
Visualize the generating function of a space figurate number in the complex plane (phase portrait).

Parameters
----------
name_seq : SpaceTypes
    Space figurate number sequence defining its generating function f(z).
m : int | None
    Parameter defining the m-gonal structure (if applicable).
plot_type : PlotType, optional
    Overrides the default plot type of the instance.
show : bool, default=True
    Whether to display the plot immediately. If False, the plot is generated but not shown.
**kwargs : dict
    Per-call plot options. Can override instance defaults:
    - xlim : tuple[float, float], optional
        Horizontal limits of the complex plane. Overrides `domain_grid_radius`.
    - ylim : tuple[float, float], optional
        Vertical limits of the complex plane. Overrides `domain_grid_radius`.
    - show_axes : bool, optional
        Whether to display the real (Re) and imaginary (Im) axes.
    - Instance defaults applied if not provided: figsize, cmap_color, brightness, num_lines, disk_radius.

Returns
-------
matplotlib.figure.Figure
    The generated figure. Automatically displayed if `show=True`.

Sequence Reference — SpaceTypes

The name_seq parameter accepts values from the table below. Each name identifies a figurate number sequence.

Pass to visualize_space(name_seq=...).

name_seqname_seqname_seq
m_pyramidaltetrahedralcubic
octahedralhauy_octahedralicosahedral
dodecahedraltruncated_tetrahedraltruncated_cubic
truncated_octahedralstella_octangulacentered_cube
rhombic_dodecahedralhauy_rhombic_dodecahedralcentered_tetrahedron
centered_square_pyramidcentered_pentagonal_pyramidcentered_hexagonal_pyramid
centered_mgonal_pyramidcentered_octahedroncentered_icosahedron
centered_dodecahedroncentered_truncated_tetrahedroncentered_truncated_cube
centered_truncated_octahedroncentered_mgonal_pyramidalmgonal_prism
generalized_mgonal_pyramidalgeneralized_cubicgeneralized_octahedral
generalized_icosahedralgeneralized_dodecahedralgeneralized_centered_cube
generalized_centered_tetrahedrongeneralized_centered_square_pyramidgeneralized_rhombic_dodecahedral
generalized_centered_mgonal_pyramidalgeneralized_hexagonal_prism

visualize_multidim

visualize_multidim(
    name_seq : MultiDimTypes,
    *,
    m : int | None = None,
    k : int | None = None,
    plot_type : PlotType | None = None,
    show : bool = True,
    **kwargs,
)
Visualize the generating function of a multidimensional figurate number in the complex plane (phase portrait).

Parameters
----------
name_seq : MultiDimTypes
    Multidimensional figurate number sequence defining its generating function f(z).
m : int | None
    Parameter defining the m-gonal structure (if applicable).
k : int | None
    Parameter defining the k-dimensional structure (if applicable).
plot_type : PlotType, optional
    Overrides the default plot type of the instance.
show : bool, default=True
    Whether to display the plot immediately. If False, the plot is generated but not shown.
**kwargs : dict
    Per-call plot options. Can override instance defaults:
    - xlim : tuple[float, float], optional
        Horizontal limits of the complex plane. Overrides `domain_grid_radius`.
    - ylim : tuple[float, float], optional
        Vertical limits of the complex plane. Overrides `domain_grid_radius`.
    - show_axes : bool, optional
        Whether to display the real (Re) and imaginary (Im) axes.
    - Instance defaults applied if not provided: figsize, cmap_color, brightness, num_lines, disk_radius.

Returns
-------
matplotlib.figure.Figure
    The generated figure. Automatically displayed if `show=True`.

Sequence Reference — MultiDimTypes

The name_seq parameter accepts values from the table below. Each name identifies a figurate number sequence.

Pass to visualize_multidim(name_seq=...).

name_seqname_seqname_seq
hypertetrahedralhypercubehyperoctahedral
hypericosahedralhyperdodecahedralpolyoctahedral
k_dim_hypertetrahedronk_dim_hypercubek_dim_hyperoctahedron
k_dim_nexusfour_dim_mgonal_pyramidalk_dim_mgonal_pyramidal
centered_biquadraticcentered_hypertetrahedroncentered_hyperoctahedron
k_dim_centered_hypercubek_dim_centered_hypertetrahedronk_dim_centered_hyperoctahedron
generalized_pentatopegeneralized_k_dim_hypertetrahedrongeneralized_biquadratic
generalized_k_dim_hypercubegeneralized_k_dim_hyperoctahedron
© 2026 Edgar Delgado Vega