Skip to content

Instantly share code, notes, and snippets.

@digitalsignalperson
digitalsignalperson / move_axes.py
Last active January 27, 2024 06:07 — forked from salotz/move_axes.py
Move a matplotlib Axes from one figure to another.
def move_axes(ax, fig, subplot_args, remove=False):
"""Move an Axes object from a figure to a new pyplot managed Figure in
the specified subplot.
ax = the original Axes
fig = the new figure
subplot_args = where to put the ax in the new figure, e.g. (nrows, ncols, index)
"""
# get a reference to the old figure context so we can release it
@digitalsignalperson
digitalsignalperson / qemu_netdev_socket_vlan.md
Created June 10, 2022 18:47 — forked from mcastelino/qemu_netdev_socket_vlan.md
QEMU usermode virtual vlan using -netdev socket

Goal

How to launch multiple QEMU based VM's that can communicate with the outside world and between each other other without any setup on the host.

This uses two features available in qemu

  • User Mode Networking stack - SLIRP
  • Socket networking backend allows you to create a network of guests that can see each other

This allows us to have