I’m trying to recreate the following image using Makie and I’m having issues with some of the final formatting:
So far, I managed to come up with the following:
using CairoMakie
age_groups = ["0-12", "13-24", "25-36", "37-48", "49-60"]
num_individuals = [35, 23, 17, 13, 12]
barplot(
num_individuals,
color=:black,
strokecolor=:white,
strokewidth=1,
width=0.5,
gap=0,
axis = (
xlabel="Age Groups (in African Elephant years)",
ylabel="Relative Abundance (%)",
title="Type A Profile",
limits=(nothing, nothing, 0, 35),
yticks=(0:5:35),
xticks=(1:5, age_groups),
topspinevisible=false,
rightspinevisible=false,
xgridvisible=false,
ygridvisible=false,
xticksvisible=false
)
)
To make the plot look more like the original, I’d like to eliminate the spacing between the bars including eliminating the space between the first bar and the y-axis. I’d like to also place tick marks between the bars along the x-axis. I’d also like to change the font to Arial, but I’ve been having difficulty figuring out how to do that.
Last, but not least, whenever I’ve tried exporting the figure, I’ve always ended up with a solid white image regardless of the format. I’m interested in a vector format, hence why I’m using CairoMakie.
Are all of these things possible using Makie? Would another plotting package be more capable?
Any help would be greatly appreciated. Thanks!