# Add title and axis labels using abmplot

**URL:** https://discourse.julialang.org/t/add-title-and-axis-labels-using-abmplot/114593
**Category:** Visualization
**Tags:** agentsjl
**Created:** [May 22, 2024, 10:51pm UTC](https://discourse.julialang.org/t/add-title-and-axis-labels-using-abmplot/114593 "2024-05-22T22:51:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![daler6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daler6/32/13930_2.png) [@daler6](https://discourse.julialang.org/u/daler6)
#### Post date: [May 22, 2024, 10:51pm UTC](https://discourse.julialang.org/t/add-title-and-axis-labels-using-abmplot/114593/1 "2024-05-22T22:51:23Z")

</div>

Hi,

I am using the abmplot function in Agents.jl to plot the location of my agents. It is plotting the agents fine, but I would like to add a title and axis labels. Nothing I have done seems to work. I am using CairoMakie and the relevant code is below. Where do I put the title = “Title” and xlable = “xlabel” statements?

#MAKE a STATIC PLOT of AGENTS

#set up the plot

offset(a) = a isa Bank ? (-0.1, -0.1_rand()) : (+0.1, +0.1_rand())

ashape(a) = a isa Bank ? :circle : :utriangle

#MAKE a STATIC PLOT of AGENTS  
#set up the plot  
offset(a) = a isa Bank ? (-0.1, -0.1_rand()) : (+0.1, +0.1_rand())  
ashape(a) = a isa Bank ? :circle : :utriangleacolor(a) = a isa Bank ? a.acolor : :blue  
plotkwargs = (;  
agent\_color = acolor,  
agent\_size = 10,  
agent\_marker = ashape,  
offset,  
agentsplotkwargs = (strokewidth = 1.0, strokecolor = :black),  
)

#create the plot  
fig, ax, abmobs = abmplot(testmodel; plotkwargs…)

#see the plot  
fig

---

<div class="post-metadata">

### Author: ![daler6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daler6/32/13930_2.png) [@daler6](https://discourse.julialang.org/u/daler6)
#### Post date: [May 23, 2024, 11:54am UTC](https://discourse.julialang.org/t/add-title-and-axis-labels-using-abmplot/114593/2 "2024-05-23T11:54:52Z")

</div>

Solution provided on Julia slack channel dynamics-bridged:  
Add modifications to ax after using abmplot(), such as

#create the plot  
fig, ax, abmobs = abmplot(testmodel; plotkwargs…)  
ax.title = “Title”  
ax.xlabel = “East-West”  
ax.ylabel = “North-South”  
#see the plot  
fig
