Skip to content

Commit

Permalink
feat: Refactor cdraw! function to support vertical colorbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Beforerr committed Oct 23, 2024
1 parent 3e9fcf6 commit 6121385
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/aog.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using AlgebraOfGraphics: default_isvertical

const SUPPORTED_POS = [:top, :bottom, :left, :right]

Base.:*(l::Layer, p::NamedTuple) = l * mapping(; p...)
Expand Down Expand Up @@ -25,10 +27,10 @@ end
Like `AlgebraOfGraphics.draw!`, but adds a colorbar.
"""
function cdraw!(f::GridLayout, args...; position=:right, kw...)
function cdraw!(f::GridLayout, args...; position=:right, vertical=default_isvertical(position), kw...)
grids = draw!(f[1, 1], args...; kw...)
guide_pos = guides_position(f, position)
colorbar!(guide_pos, grids)
colorbar!(guide_pos, grids; vertical)
return grids
end

Expand Down

0 comments on commit 6121385

Please sign in to comment.