Skip to content

Commit

Permalink
legend: increase gap
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeket committed Sep 16, 2020
1 parent 261a3f5 commit a61b8ae
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions plot-lib/plot/private/plot3d/plot-area.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,16 @@
(cond
[legend-rect
(match-define (vector (ivl x- x+) (ivl y- y+)) legend-rect)
(define gap (* 2 (pen-gap)))
(define width (if (and x- x+) (+ gap (- x+ x-)) 0))
(define height (if (and y- y+) (+ gap (- y+ y-)) 0))
(define 2*gap (* 2 (pen-gap)))
(define 3*gap (* 3 (pen-gap)))
(define width (if (and x- x+) (+ 2*gap (- x+ x-)) 0))
(define height (if (and y- y+) (+ 2*gap (- y+ y-)) 0))
(define x-size-left (- dc-x-size width))
(define y-size-left (- dc-y-size title-margin height))
(define (left) (if (< x-size-left 0) (none) (values width 0 title-margin 0)))
(define (top) (if (< y-size-left 0) (none) (values 0 0 (+ title-margin height) 0)))
(define (bottom) (if (< y-size-left 0) (none) (values 0 0 title-margin height)))
(define (right) (if (< x-size-left 0) (none) (values 0 width title-margin 0)))
(define (left) (if (< x-size-left 0) (none) (values (+ width 3*gap) 0 title-margin 0)))
(define (top) (if (< y-size-left 0) (none) (values 0 0 (+ title-margin height 3*gap) 0)))
(define (bottom) (if (< y-size-left 0) (none) (values 0 0 title-margin (+ height 3*gap))))
(define (right) (if (< x-size-left 0) (none) (values 0 (+ width 3*gap) title-margin 0)))
(case legend-anchor
[(top-left auto) (if (< y-size-left x-size-left) (left) (top))]
[(left) (left)]
Expand Down

0 comments on commit a61b8ae

Please sign in to comment.