Fixed error: attempt to divide by (void) when axis bounds' length is a multiple of 1000
Please merge into 5.2
This commit is contained in:
parent
90304687f1
commit
a0e2401cbe
|
@ -29,9 +29,9 @@
|
|||
(define e (floor-log10 (- x-max x-min)))
|
||||
(define mag (expt 10 e))
|
||||
(define step (let ([y (/ (- x-max x-min) mag)])
|
||||
(cond [(y . < . 2) (* 1/5 mag)]
|
||||
[(y . < . 5) (* 1/2 mag)]
|
||||
[(y . < . 10) mag])))
|
||||
(cond [(y . < . 2) (* 1/5 mag)]
|
||||
[(y . < . 5) (* 1/2 mag)]
|
||||
[else mag])))
|
||||
(define start (* (ceiling (/ x-min step)) step))
|
||||
(define stop (* (floor (/ x-max step)) step))
|
||||
(define num (+ 1 (round (/ (- stop start) step))))
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
(plot empty #:x-min -1 #:x-max 1 #:y-min -1 #:y-max 1)
|
||||
|
||||
(time (plot (function values 0 1000)))
|
||||
|
||||
(parameterize ([plot-background "black"]
|
||||
[plot-foreground "white"]
|
||||
[plot-background-alpha 1/2]
|
||||
|
|
Loading…
Reference in New Issue
Block a user