Source code for neuralib.atlas.plot

from pathlib import Path

from neuralib.atlas.data import load_bg_structure_tree
from neuralib.typing import PathLike

__all__ = ['plot_sunburst_acronym',
           'print_tree']


[docs] def plot_sunburst_acronym(output: PathLike | None = None): """ Plot allen brain structure tree interactive plot :param output: figure output path, otherwise, render interactively :return: """ from plotly import express as px data = load_bg_structure_tree(paired=True) data = dict(names=data['acronym'].to_list(), parents=data['parent_acronym'].to_list()) # fig = px.sunburst( data, names='names', parents='parents', ) if output is not None: fig.write_image(output) else: fig.show()