File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1050,16 +1050,18 @@ continFnPlot f = def{
10501050 , isTintableMonochromic = True
10511051 , axesNecessity = 1
10521052 , dynamicPlot = plot }
1053- where yRangef = onInterval $ \ (l, r) -> ((! 10 ) &&& (! 70 )) . sort . pruneOutlyers
1053+ where yRangef = onInterval $ \ (l, r) -> ((!% 0.1 ) &&& (!% 0.9 )) . sort . pruneOutlyers
10541054 $ map f [l, l + (r- l)/ 80 .. r]
10551055 plot (GraphWindowSpecR2 {.. }) = curve `deepseq` mkPlot (trace curve)
10561056 where δx = (rBound - lBound) * 2 / fromIntegral xResolution
10571057 curve = [ (x ^& f x) | x<- [lBound, lBound+ δx .. rBound] ]
10581058 trace (p: q: ps) = simpleLine p q <> trace (q: ps)
10591059 trace _ = mempty
10601060 pruneOutlyers = filter (not . isNaN )
1061- l! n | (x: _)<- drop n l = x
1062- | otherwise = error " Function appears to yield NaN most of the time. Cannot be plotted."
1061+ l!% η = case length l of
1062+ ll | ll< 2 -> error
1063+ " Function appears to yield NaN most of the time. Cannot be plotted."
1064+ | otherwise -> l !! floor (fromIntegral ll * η)
10631065
10641066
10651067type (--> ) = RWDiffable ℝ
You can’t perform that action at this time.
0 commit comments