Skip to content

Commit 634a13e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents d0c8c07 + d680bf4 commit 634a13e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

docs/getting_started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class MyModel(Model):
188188
def __init__(self, n_agents=10, seed=None):
189189
super().__init__(seed=seed)
190190
# Initialize the model with N agents
191-
192-
The core functionality for building your own visualizations resides in the [`mesa.visualization`](apis/visualization) namespace
191+
```
192+
The core functionality for building your own visualizations resides in the [`mesa.visualization`](apis/visualization) namespace.
193193

194194
Here's a basic example of how to set up a visualization:
195195

docs/tutorials/intro_tutorial.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@
111111
{
112112
"cell_type": "raw",
113113
"metadata": {},
114-
"source": "pip install --quiet --upgrade mesa[rec] #installs Mesa 3.1.3"
114+
"source": [
115+
"pip install --quiet --upgrade mesa[rec] #installs Mesa 3.1.3"
116+
]
115117
},
116118
{
117119
"cell_type": "markdown",
@@ -607,8 +609,8 @@
607609
" # Create agents\n",
608610
" agents = MoneyAgent.create_agents(model=self, n=n)\n",
609611
" # Create x and y positions for agents\n",
610-
" x = self.rng.randint(0, self.grid.width, size=(n,))\n",
611-
" y = self.rng.randint(0, self.grid.height, size=(n,))\n",
612+
" x = self.rng.integers(0, self.grid.width, size=(n,))\n",
613+
" y = self.rng.integers(0, self.grid.height, size=(n,))\n",
612614
" for a, i, j in zip(agents, x, y):\n",
613615
" # Add the agent to a random grid cell\n",
614616
" self.grid.place_agent(a, (i, j))"

mesa/examples/advanced/sugarscape_g1mt/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ def portray(g):
2929
cmap="spring",
3030
origin="lower",
3131
)
32-
fig.colorbar(im, orientation="vertical")
32+
fig.colorbar(im, ax=ax, orientation="vertical", pad=0.1, fraction=0.046)
3333
# Spice
34-
ax.imshow(
34+
im_spice = ax.imshow(
3535
np.ma.masked_where(model.grid.spice.data <= 1, model.grid.spice.data),
3636
cmap="winter",
3737
origin="lower",
3838
)
39+
fig.colorbar(im_spice, ax=ax, orientation="vertical", fraction=0.046, pad=0.04)
3940
# Trader
4041
ax.scatter(**out["trader"])
4142
ax.set_axis_off()

0 commit comments

Comments
 (0)