How to use the ipympl.backend_nbagg.FigureManagerNbAgg function in ipympl

To help you get started, we’ve selected a few ipympl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xoolive / traffic / traffic / drawing / ipywidgets.py View on Github external
def __init__(self, traffic: Traffic, projection=EuroPP()) -> None:

        ipython = get_ipython()
        ipython.magic("matplotlib ipympl")
        from ipympl.backend_nbagg import FigureCanvasNbAgg, FigureManagerNbAgg

        self.fig_map = Figure(figsize=(6, 6))
        self.fig_time = Figure(figsize=(6, 4))

        self.canvas_map = FigureCanvasNbAgg(self.fig_map)
        self.canvas_time = FigureCanvasNbAgg(self.fig_time)

        self.manager_map = FigureManagerNbAgg(self.canvas_map, 0)
        self.manager_time = FigureManagerNbAgg(self.canvas_time, 0)

        layout = {"width": "590px", "height": "800px", "border": "none"}
        self.output = Output(layout=layout)

        self._traffic = traffic
        self.t_view = traffic.sort_values("timestamp")
        self.trajectories: Dict[str, List[Artist]] = defaultdict(list)

        self.create_map(projection)

        self.projection = Dropdown(options=["EuroPP", "Lambert93", "Mercator"])
        self.projection.observe(self.on_projection_change)

        self.identifier_input = Text(description="Callsign/ID")
        self.identifier_input.observe(self.on_id_input)
github xoolive / traffic / traffic / drawing / ipywidgets.py View on Github external
def __init__(self, traffic: Traffic, projection=EuroPP()) -> None:

        ipython = get_ipython()
        ipython.magic("matplotlib ipympl")
        from ipympl.backend_nbagg import FigureCanvasNbAgg, FigureManagerNbAgg

        self.fig_map = Figure(figsize=(6, 6))
        self.fig_time = Figure(figsize=(6, 4))

        self.canvas_map = FigureCanvasNbAgg(self.fig_map)
        self.canvas_time = FigureCanvasNbAgg(self.fig_time)

        self.manager_map = FigureManagerNbAgg(self.canvas_map, 0)
        self.manager_time = FigureManagerNbAgg(self.canvas_time, 0)

        layout = {"width": "590px", "height": "800px", "border": "none"}
        self.output = Output(layout=layout)

        self._traffic = traffic
        self.t_view = traffic.sort_values("timestamp")
        self.trajectories: Dict[str, List[Artist]] = defaultdict(list)

        self.create_map(projection)

        self.projection = Dropdown(options=["EuroPP", "Lambert93", "Mercator"])
        self.projection.observe(self.on_projection_change)

        self.identifier_input = Text(description="Callsign/ID")
        self.identifier_input.observe(self.on_id_input)