Revert "Added #:add-ticks? argument to all 2d-renderer-producing functions"
I forgot that (plot-x-ticks no-ticks) does the same thing.
This reverts commit 8ae3ff48d8
.
This commit is contained in:
parent
ffe39c5974
commit
ef2bd3fc0a
|
@ -44,12 +44,11 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
(define g (2d-function->sampler f (vector x-ivl y-ivl)))
|
||||
(renderer2d (vector x-ivl y-ivl) #f (if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector x-ivl y-ivl) #f default-ticks-fun
|
||||
(isoline-render-proc g z samples color width style alpha label)))
|
||||
|
||||
;; ===================================================================================================
|
||||
|
@ -101,12 +100,11 @@
|
|||
[#:styles styles (plot-pen-styles/c (listof real?)) (contour-styles)]
|
||||
[#:alphas alphas (alphas/c (listof real?)) (contour-alphas)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
(define g (2d-function->sampler f (vector x-ivl y-ivl)))
|
||||
(renderer2d (vector x-ivl y-ivl) #f (if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector x-ivl y-ivl) #f default-ticks-fun
|
||||
(contours-render-proc g levels samples colors widths styles alphas label)))
|
||||
|
||||
;; ===================================================================================================
|
||||
|
@ -182,12 +180,11 @@
|
|||
[#:contour-styles contour-styles (plot-pen-styles/c (listof real?)) (contour-styles)]
|
||||
[#:alphas alphas (alphas/c (listof ivl?)) (contour-interval-alphas)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
(define g (2d-function->sampler f (vector x-ivl y-ivl)))
|
||||
(renderer2d (vector x-ivl y-ivl) #f (if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector x-ivl y-ivl) #f default-ticks-fun
|
||||
(contour-intervals-render-proc g levels samples colors styles
|
||||
contour-colors contour-widths contour-styles
|
||||
alphas label)))
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
[#:line2-style line2-style plot-pen-style/c (interval-line2-style)]
|
||||
[#:alpha alpha (real-in 0 1) (interval-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define rvs (filter vrational? (append v1s v2s)))
|
||||
(cond
|
||||
|
@ -58,8 +57,7 @@
|
|||
[x-max (if x-max x-max (apply max* rxs))]
|
||||
[y-min (if y-min y-min (apply min* rys))]
|
||||
[y-max (if y-max y-max (apply max* rys))])
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(lines-interval-render-proc v1s v2s color style
|
||||
line1-color line1-width line1-style
|
||||
line2-color line2-width line2-style
|
||||
|
@ -82,7 +80,6 @@
|
|||
[#:line2-style line2-style plot-pen-style/c (interval-line2-style)]
|
||||
[#:alpha alpha (real-in 0 1) (interval-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(lines-interval
|
||||
(map f1 (linear-seq t-min t-max samples))
|
||||
|
@ -91,7 +88,7 @@
|
|||
#:color color #:style style
|
||||
#:line1-color line1-color #:line1-width line1-width #:line1-style line1-style
|
||||
#:line2-color line2-color #:line2-width line2-width #:line2-style line2-style
|
||||
#:alpha alpha #:label label #:add-ticks? add-ticks?))
|
||||
#:alpha alpha #:label label))
|
||||
|
||||
(defproc (polar-interval
|
||||
[f1 (real? . -> . real?)] [f2 (real? . -> . real?)]
|
||||
|
@ -109,7 +106,6 @@
|
|||
[#:line2-style line2-style plot-pen-style/c (interval-line2-style)]
|
||||
[#:alpha alpha (real-in 0 1) (interval-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define θs (linear-seq θ-min θ-max samples))
|
||||
(lines-interval
|
||||
|
@ -119,7 +115,7 @@
|
|||
#:color color #:style style
|
||||
#:line1-color line1-color #:line1-width line1-width #:line1-style line1-style
|
||||
#:line2-color line2-color #:line2-width line2-width #:line2-style line2-style
|
||||
#:alpha alpha #:label label #:add-ticks? add-ticks?))
|
||||
#:alpha alpha #:label label))
|
||||
|
||||
;; ===================================================================================================
|
||||
;; Function
|
||||
|
@ -156,7 +152,6 @@
|
|||
[#:line2-style line2-style plot-pen-style/c (interval-line2-style)]
|
||||
[#:alpha alpha (real-in 0 1) (interval-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
|
@ -164,7 +159,7 @@
|
|||
(define g2 (function->sampler f2 x-ivl))
|
||||
(renderer2d (vector x-ivl y-ivl)
|
||||
(function-interval-bounds-fun g1 g2 samples)
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
default-ticks-fun
|
||||
(function-interval-render-proc g1 g2 samples color style
|
||||
line1-color line1-width line1-style
|
||||
line2-color line2-width line2-style
|
||||
|
@ -205,7 +200,6 @@
|
|||
[#:line2-style line2-style plot-pen-style/c (interval-line2-style)]
|
||||
[#:alpha alpha (real-in 0 1) (interval-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
|
@ -213,7 +207,7 @@
|
|||
(define g2 (inverse->sampler f2 y-ivl))
|
||||
(renderer2d (vector x-ivl y-ivl)
|
||||
(inverse-interval-bounds-fun g1 g2 samples)
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
default-ticks-fun
|
||||
(inverse-interval-render-proc g1 g2 samples color style
|
||||
line1-color line1-width line1-style
|
||||
line2-color line2-width line2-style
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define rvs (filter vrational? vs))
|
||||
(cond [(empty? rvs) (renderer2d #f #f #f #f)]
|
||||
|
@ -37,8 +36,7 @@
|
|||
[x-max (if x-max x-max (apply max* rxs))]
|
||||
[y-min (if y-min y-min (apply min* rys))]
|
||||
[y-max (if y-max y-max (apply max* rys))])
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(lines-render-proc vs color width style alpha label)))]))
|
||||
|
||||
(defproc (parametric [f (real? . -> . (vector/c real? real?))]
|
||||
|
@ -51,12 +49,11 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(lines (map f (linear-seq t-min t-max samples))
|
||||
#:x-min x-min #:x-max x-max #:y-min y-min #:y-max y-max
|
||||
#:color color #:width width #:style style #:alpha alpha
|
||||
#:label label #:add-ticks? add-ticks?))
|
||||
#:label label))
|
||||
|
||||
(defproc (polar [f (real? . -> . real?)]
|
||||
[θ-min real? 0] [θ-max real? (* 2 pi)]
|
||||
|
@ -68,13 +65,12 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(lines (let ([θs (linear-seq θ-min θ-max samples)])
|
||||
(map polar->cartesian θs (map* f θs)))
|
||||
#:x-min x-min #:x-max x-max #:y-min y-min #:y-max y-max
|
||||
#:color color #:width width #:style style #:alpha alpha
|
||||
#:label label #:add-ticks? add-ticks?))
|
||||
#:label label))
|
||||
|
||||
;; ===================================================================================================
|
||||
;; Function
|
||||
|
@ -99,14 +95,13 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
(let ([f (function->sampler f x-ivl)])
|
||||
(renderer2d (vector x-ivl y-ivl)
|
||||
(function-bounds-fun f samples)
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
default-ticks-fun
|
||||
(function-render-proc f samples color width style alpha label))))
|
||||
|
||||
;; ===================================================================================================
|
||||
|
@ -132,14 +127,13 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define x-ivl (ivl x-min x-max))
|
||||
(define y-ivl (ivl y-min y-max))
|
||||
(define g (inverse->sampler f y-ivl))
|
||||
(renderer2d (vector x-ivl y-ivl)
|
||||
(inverse-bounds-fun g samples)
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
default-ticks-fun
|
||||
(inverse-render-proc g samples color width style alpha label)))
|
||||
|
||||
;; ===================================================================================================
|
||||
|
@ -154,7 +148,6 @@
|
|||
[#:style style plot-pen-style/c (line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (line-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(define n (length xs))
|
||||
(define sd (sqrt (- (/ (sum sqr xs) n) (sqr (/ (sum values xs) n)))))
|
||||
|
@ -163,5 +156,4 @@
|
|||
(let ([x-min (if x-min x-min fx-min)]
|
||||
[x-max (if x-max x-max fx-max)])
|
||||
(function f x-min x-max #:y-min y-min #:y-max y-max #:samples samples
|
||||
#:color color #:width width #:style style #:alpha alpha #:label label
|
||||
#:add-ticks? add-ticks?)))
|
||||
#:color color #:width width #:style style #:alpha alpha #:label label)))
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
[#:line-width line-width (>=/c 0) (point-line-width)]
|
||||
[#:alpha alpha (real-in 0 1) (point-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(let ([vs (filter vrational? vs)])
|
||||
(cond
|
||||
|
@ -40,8 +39,7 @@
|
|||
[y-min (if y-min y-min (apply min* ys))]
|
||||
[y-max (if y-max y-max (apply max* ys))])
|
||||
(renderer2d
|
||||
(vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(points-render-fun vs sym color (cond [(eq? fill-color 'auto) (->pen-color color)]
|
||||
[else fill-color])
|
||||
size line-width alpha label)))])))
|
||||
|
@ -102,12 +100,10 @@
|
|||
[#:line-style line-style plot-pen-style/c (vector-field-line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (vector-field-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(let ([f (cond [(procedure-arity-includes? f 2 #t) f]
|
||||
[else (λ (x y) (f (vector x y)))])])
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(vector-field-render-fun f samples scale color line-width line-style alpha label))))
|
||||
|
||||
;; ===================================================================================================
|
||||
|
@ -138,7 +134,6 @@
|
|||
[#:line-style line-style plot-pen-style/c (error-bar-line-style)]
|
||||
[#:width width (>=/c 0) (error-bar-width)]
|
||||
[#:alpha alpha (real-in 0 1) (error-bar-alpha)]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(let ([bars (filter vrational? bars)])
|
||||
(cond [(empty? bars) (renderer2d #f #f #f #f)]
|
||||
|
@ -148,7 +143,6 @@
|
|||
[x-max (if x-max x-max (apply max* xs))]
|
||||
[y-min (if y-min y-min (apply min* (map - ys hs)))]
|
||||
[y-max (if y-max y-max (apply max* (map + ys hs)))])
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(error-bars-render-fun xs ys hs
|
||||
color line-width line-style width alpha)))])))
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
[#:line-style line-style plot-pen-style/c (rectangle-line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (rectangle-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(match-define (list (vector (ivl x1s x2s) (ivl y1s y2s)) ...) rects)
|
||||
(define rxs (filter rational? (append x1s x2s)))
|
||||
|
@ -46,8 +45,7 @@
|
|||
[x-max (if x-max x-max (apply max* rxs))]
|
||||
[y-min (if y-min y-min (apply min* rys))]
|
||||
[y-max (if y-max y-max (apply max* rys))])
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? default-ticks-fun #f)
|
||||
(renderer2d (vector (ivl x-min x-max) (ivl y-min y-max)) #f default-ticks-fun
|
||||
(rectangles-render-proc rects color style line-color line-width line-style alpha
|
||||
label)))]))
|
||||
|
||||
|
@ -67,7 +65,6 @@
|
|||
[#:line-style line-style plot-pen-style/c (rectangle-line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (rectangle-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
) renderer2d?
|
||||
(let* ([bin-bounds (filter rational? bin-bounds)]
|
||||
[bin-bounds (sort bin-bounds <)])
|
||||
|
@ -87,7 +84,7 @@
|
|||
(bounds->intervals bin-bounds) heights)
|
||||
#:x-min x-min #:x-max x-max #:y-min y-min #:y-max y-max
|
||||
#:color color #:style style #:line-color line-color #:line-width line-width
|
||||
#:line-style line-style #:alpha alpha #:label label #:add-ticks? add-ticks?)])))
|
||||
#:line-style line-style #:alpha alpha #:label label)])))
|
||||
|
||||
;; ===================================================================================================
|
||||
;; Discrete histograms
|
||||
|
@ -121,7 +118,6 @@
|
|||
[#:line-style line-style plot-pen-style/c (rectangle-line-style)]
|
||||
[#:alpha alpha (real-in 0 1) (rectangle-alpha)]
|
||||
[#:label label (or/c string? #f) #f]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
[#:far-ticks? far-ticks? boolean? #f]
|
||||
) renderer2d?
|
||||
(match-define (list (vector cats ys) ...) cat-vals)
|
||||
|
@ -145,7 +141,7 @@
|
|||
(define maybe-invert (if invert? (λ (x y) (vector y x)) vector))
|
||||
(renderer2d
|
||||
(maybe-invert (ivl x-min x-max) (ivl y-min y-max)) #f
|
||||
(if add-ticks? (discrete-histogram-ticks-fun cats tick-xs far-ticks? maybe-invert) #f)
|
||||
(discrete-histogram-ticks-fun cats tick-xs far-ticks? maybe-invert)
|
||||
(rectangles-render-proc (map maybe-invert x-ivls y-ivls)
|
||||
color style line-color line-width line-style alpha label)))]))
|
||||
|
||||
|
@ -163,7 +159,6 @@
|
|||
[#:line-styles line-styles (plot-pen-styles/c nat/c) (stacked-histogram-line-styles)]
|
||||
[#:alphas alphas (alphas/c nat/c) (stacked-histogram-alphas)]
|
||||
[#:labels labels (labels/c nat/c) '(#f)]
|
||||
[#:add-ticks? add-ticks? boolean? #t]
|
||||
[#:far-ticks? far-ticks? boolean? #f]
|
||||
) (listof renderer2d?)
|
||||
(match-define (list (vector cats ys) ...) cat-vals)
|
||||
|
@ -185,5 +180,4 @@
|
|||
#:x-min x-min #:x-max x-max #:y-min y-min #:y-max y-max
|
||||
#:gap gap #:skip skip #:invert? invert?
|
||||
#:color color #:style style #:line-color line-color #:line-width line-width
|
||||
#:line-style line-style #:alpha alpha #:label label
|
||||
#:add-ticks? add-ticks? #:far-ticks? far-ticks?)))
|
||||
#:line-style line-style #:alpha alpha #:label label #:far-ticks? far-ticks?)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user