Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!convex.UUCP!root From: root@convex.UUCP (Superuser) Newsgroups: comp.windows.x Subject: Lost mail for you Message-ID: <9006071721.AA14597@sushi> Date: 7 Jun 90 17:21:24 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 105 From pescadero.stanford.edu!expo.lcs.mit.edu!xpert-mailer Thu May 31 22:04:29 1990 remote from convex Received: by sushi (5.51/7.0) id AA24219; Thu, 31 May 90 22:04:29 CDT Received: by convex.COM (5.51/4.7) id AA08582; Thu, 31 May 90 22:04:24 CDT Received: from Erebus.Stanford.EDU by uxc.cso.uiuc.edu with SMTP (5.62+/IDA-1.2.8) id AA07798; Thu, 31 May 90 22:00:01 -0500 Received: from Hanauma.Stanford.EDU by erebus.Stanford.EDU with TCP; Thu, 31 May 90 19:46:39 PDT Received: by hanauma.stanford.edu (5.51/7.0) id AA03138; Thu, 31 May 90 19:59:53 PDT Received: from EXPO.LCS.MIT.EDU by Pescadero.Stanford.EDU (5.59/25-eef) id AA19740; Thu, 31 May 90 19:58:45 PDT Received: by expo.lcs.mit.edu; Thu, 31 May 90 17:53:43 EDT Received: from ATHENA.MIT.EDU by expo.lcs.mit.edu; Thu, 31 May 90 17:53:30 EDT Received: from Larry.McRCIM.McGill.EDU by ATHENA.MIT.EDU with SMTP id AA10789; Thu, 31 May 90 17:54:56 EDT Received: by Larry.McRCIM.McGill.EDU (5.61) id <9005312154.AA01265@Larry.McRCIM.McGill.EDU>; Thu, 31 May 90 17:54:31 -0400 Date: Thu, 31 May 90 17:54:31 -0400 From: der Mouse Message-Id: <9005312154.AA01265@Larry.McRCIM.McGill.EDU> To: rmr@mimsy.umd.edu Subject: Re: zooming time scales Cc: xpert@expo.lcs.mit.edu > [ problem: wants to choose a "nice" tick interval for a given time > interval ] It's not directly what you want, but we once designed the following code to do something similar for floating-point intervals. You may be able to abstract some ideas from it for your needs. (This is not compilable as it stands; it is intended as illustrative rather than as a plug-&-play solution.) #define NUM_DIVISIONS 10 /* we want approx. 10 ticks per axis */ double findScale(min, max) double min; double max; { double delta; double minScale; double scale; static int factor[] = { 1, 2, 5 }; int i; delta = FABS(max - min)/NUM_DIVISIONS; minScale = FABS(max - min); for (i=0; i