Replies: 1 comment 1 reply
-
I think this is a good solution: from mesa.experimental import prepare_matplotlib_space
@prepare_matplotlib_space
def space_drawer(viz, fig, ax):
graph = viz.model.grid.G
pos = nx.circular_layout(graph, seed=0)
nx.draw(
graph,
ax=ax,
pos=pos,
**agent_portrayal(graph),
) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, this is how you would specify a custom space drawer: #1769 (comment)
I'm tempted to simplify it to
But the drawback is that it is hardcoded to be a Matplotlib visualization. Some people might want to use other Solara-supported visualization, such as Plotly.
Beta Was this translation helpful? Give feedback.
All reactions