shithub: riscv

Download patch

ref: f102882990af8f9336824f81d24eb2ee1648c9dc
parent: 55f067553a073c05e169adc0b95ad9d7f7269640
author: aiju <devnull@localhost>
date: Fri Nov 30 11:12:02 EST 2018

fplot: compute y range correctly when used with multiple graphs

--- a/sys/src/cmd/fplot.c
+++ b/sys/src/cmd/fplot.c
@@ -410,8 +410,6 @@
 {
 	int x;
 	
-	gymin = Inf(1);
-	gymax = Inf(-1);
 	for(x = r->min.x; x < r->max.x; x++)
 		drawinter(co, r, convx(r, x), convx(r, x + 1), 0);
 }
@@ -567,6 +565,8 @@
 	int i;
 	
 	color = display->black;
+	gymin = Inf(1);
+	gymax = Inf(-1);
 	for(i = 0; i < nfns; i++)
 		drawgraph(&fns[i], &screen->r);
 	if(!aflag)