A couple of unrelated points: it’s a bit unconvential to use plot!()
to get the plot to show up. A more conventional way would be:
plt = plot(layout = 4,xlims=(-3,3),leg=false)
for i in 1:4
histogram!(plt, randn(10000),norm=true,color=:grey,xaxis = "Values",yaxis = "Density",subplot=i)
end
display(plt)
Also, note that the same plot can be achieved with the following syntax:
histogram(randn(10000, 4),norm=true,color=:grey,xaxis = "Values",yaxis = "Density",
layout = 4, xlims = (-3, 3))
The keyword you are looking for is margin
, so:
using Plots.Measures
histogram(randn(10000, 4),norm=true,color=:grey,xaxis = "Values",yaxis = "Density",
layout = 4, xlims = (-3, 3), margin = 5mm)
should give you more space. You can use top_margin
, left_margin
etc. to only add margin along some directions.