Visualization

class gefest.core.viz.struct_vizualizer.StructVizualizer(domain: Domain | None = None)[source]

Bases: object

The object for mapping a Structure or Polygon.

Examples

>>> from gefest.core.structure.domain import Domain
>>> from gefest.core.viz.struct_vizualizer import StructVizualizer
>>> domain = Domain()
>>> viz = StructVizualizer(domain)
plot_structure(structs: list[Structure], infos=None, linestyles='-', legend=False)[source]

The method displays the given list[obj:Structure].

Parameters:
  • structs – the list[obj:Structure] for displaying

  • infos – the list of data to plot legend for each structure

  • linestyles – pyplot linestyles for stuctures

Examples

>>> from gefest.core.structure.structure import get_random_structure
>>> struct_1 = get_random_structure(domain)
>>> struct_2 = get_random_structure(domain)
>>> viz.plot_structure(
        [struct_1, struct_2],
        ['stucture_1', 'stucture_2'],
        [':', '-'])
Returns:

matplotlib.pyplot.figure

plot_poly(poly, linestyle, **kwargs)[source]

The method displays the given Polygon.

Parameters:
  • poly – the Polygon for displaying

  • linestyle – pyplot linestyles for polygon

Examples

>>> from gefest.core.structure.structure import get_random_poly
>>> struct = get_random_structure(domain)
>>> poly = struct.polygons[0]
>>> viz.plot_poly(poly, '-')
class gefest.core.viz.struct_vizualizer.GIFMaker(domain=None)[source]

Bases: StructVizualizer

Smple API for saving a series of plots in mp4 with moviepy.

create_frame(structure, infos)[source]

Appends new frame from given structure.

make_gif(gifname, duration=1500, loop=-1)[source]

Makes mp4 file from collected plots.