aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/p.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/p.bqn b/src/p.bqn
index 2c9972e4..a3fa568f 100644
--- a/src/p.bqn
+++ b/src/p.bqn
@@ -26,7 +26,8 @@ PairRec ← {
Plot ← {
xy ← 1e300 (⊣-⊸⌈⌊) ⍉> 𝕨 PairRec 𝕩 # organize and clip
pts ← <∘∾˘ xy
- win ← -˜`¨ bounds ← (⌊´≍⌈´)¨ pts # min and range; min and max
+ AB ← {e←(÷5e15)(⊣×⌈´)|𝕩⋄(⌊≍⌈)˝⌾(-⟜0‿e)𝕩} # ensure 0 < window size
+ win ← -˜`¨ bounds ← (AB ⌊´≍⌈´)¨ pts # min and range; min and max
ar ← 1⍟((÷4)⊸>∨1.5⊸<) ÷˜´ 1⊑¨win # height÷width
dim ← width (⊣≍×) ar
Scale ← ({¬𝕏}⌾(1⊸⊑) {𝕩÷˜𝕨-˜⊢}´¨ win) {𝕎𝕩}¨ ⊢