Created
July 26, 2021 17:19
-
-
Save NoFishLikeIan/041a953a7fd2b7ce2ffe62ad84717cdf to your computer and use it in GitHub Desktop.
Put box around annotate in Plots.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function annotatewithbox!( | |
fig::Plots.Plot, | |
text::Plots.PlotText, | |
x::Real, y::Real, Δx::Real, Δy::Real = Δx; | |
kwargs...) | |
box = Plots.Shape(:rect) | |
Plots.scale!(box, Δx, Δy) | |
Plots.translate!(box, x, y) | |
Plots.plot!(fig, box, c = :white, linestroke = :black, label = false; kwargs...) | |
Plots.annotate!(fig, x, y, text) | |
fig | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment