pyphi.mcp.server.plot#

pyphi.mcp.server.plot(target, kind='ces', view='lattice', max_relations=None)[source]#

Render one of PyPhi’s built-in visualizations.

Requires the visualize extra (pip install pyphi[visualize]). The interactive "ces" plot is returned as a path to a self-contained HTML file to open in a browser (it cannot be shown inline); the static figures are returned as an inline PNG.

Parameters:
  • target (str) – A result_ref from analyze for "ces" and "repertoires", or a substrate handle for "connectivity" and "tpm".

  • kind (str) – "ces" — the cause-effect structure (Φ-structure), interactive. "repertoires" — the cause and effect repertoires of the analysis. "connectivity" — the substrate’s causal connectivity graph. "tpm" — the state-by-state transition probability matrix.

  • view (str) – For kind="ces" only, which of the five views to draw: "lattice" (default, the inclusion Hasse diagram), "hypergraph" (the 3-D cause and effect purviews with relation faces), "scatter", "matrix", or "spectrum". ("barycentric" is a layout, not a view.)

  • max_relations (int, optional) – For kind="ces" only, draw just the strongest this-many relations by φ_r. When the structure’s relations are computed analytically (relation_computation="ANALYTICAL"), whose relation set cannot be enumerated, None draws the strongest 1000; node sizes and the spectrum view stay exact regardless. With enumerable ("CONCRETE") relations, None draws every relation. For the full direct-Python surface see get_iit_reference("visualization").

Returns:

  • For "ces", a message with the path to the interactive HTML file. For

  • the static figures, a message with the PNG path plus an inline preview.

Return type:

Any