As the title says, when I do
julia> using Plots
julia> heatmap(rand(100,100))
julia> plot!(1:100,1:100,color=:white,lw=2,legend=false)
which creates undesired whitespace between the plot and the axis.
Is there a way to fix this?
I dont even know what causes the problem...
You need to either specify the x/y limits yourself or add widen=false
to the plot command -- when you plot the line on top of the heatmap by default Julia tries to make sure you can fully see where the line starts and stops so this is where the extra padding is coming from.
Code to get what you want (I think):
heatmap(rand(100,100))
plot!(1:100,1:100,color=:white,lw=2,legend=false,widen=false,tickdirection=:out)
Note that I also added tickdirection=:out
because I think when you have things running up against the axis the ticks are more readable that way.