Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the blank axis for the space plot for a model with no space #935

Open
Tortar opened this issue Nov 17, 2023 · 0 comments
Open

Remove the blank axis for the space plot for a model with no space #935

Tortar opened this issue Nov 17, 2023 · 0 comments
Labels
plotting quality of life QoL enhancements that make user experience smoother

Comments

@Tortar
Copy link
Member

Tortar commented Nov 17, 2023

Currently this code:

using Agents
using GLMakie
using Statistics: mean

## Nothing space

@agent struct NothingAgent(NoSpaceAgent)
    age::Int
end

function nothing_step!(a, m)
    a.age += 1
    rand(abmrng(m)) < (m.d * a.age) && remove_agent!(a, m)
    if nagents(m) >= 2
        if 14 <= a.age <= 70
            rand(abmrng(m)) < (m.b * a.age) && add_agent!(m, 0)
        end
    end
end

function nothing_model()
    properties = Dict(:b => 0.003, :d => 0.002)
    model = ABM(NothingAgent; agent_step! = nothing_step!, properties)
    for _ in 1:1000
        add_agent!(model, rand(abmrng(model), 0:100))
    end
    return model
end

function nothing_test()
    model = nothing_model()
    params = Dict(:b => 0:0.0001:0.005, :d => 0:0.0005:0.01)
    adata = [(:age, maximum), (:age, mean), (:age, minimum)]
    mdata = [nagents]
    fig, _ = abmexploration(model; adata, mdata, params)
    return fig
end

produces

Screenshot from 2023-11-16 19-02-06

It would be nice to remove that blank axis.

@Tortar Tortar added plotting quality of life QoL enhancements that make user experience smoother labels Nov 17, 2023
@Tortar Tortar changed the title Remove the blank axis for the space plot for a model with nothing as space Remove the blank axis for the space plot for a model with no space Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plotting quality of life QoL enhancements that make user experience smoother
Projects
None yet
Development

No branches or pull requests

1 participant