正如标题所说,当我这样做时
julia> using Plots julia> heatmap(rand(100,100)) julia> plot!(1:100,1:100,color=:white,lw=2,legend=false)
它产生:
这会在绘图和轴之间产生不需要的空白。
有办法解决这个问题吗?
我什至不知道是什么原因导致的问题...
您需要自己指定 x/y 限制,或者将
widen=false
代码来得到你想要的(我认为):
heatmap(rand(100,100)) plot!(1:100,1:100,color=:white,lw=2,legend=false,widen=false,tickdirection=:out)
导致该图:
请注意,我还添加了
tickdirection=:out