🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.graphics
Article #1329

Re: Scaling graphs

#1329
From: rdp
Date: Mon, 14 Jul 1986 15:35
54 lines
2484 bytes
In article <14200002@ada-uts> rouil@ada-uts writes:
>
>   However I also need a method of generating logarithmic scales for the
>data.  Does anybody know a good way of generating a logarithmic scale
>from a set of points.
>
>   Once you have the logarithmic scale how do you map betwen the scale
>distance and the plotter distance.
>
>   This program will be written in DEC fortran on a VAX.  If there is
>public domain code out there please let me know about it.
>

But I have problems here with mail so I will post: 
 
From the "Collected Algorithms from CACM" one finds Algorithm 463:
"Algorithms SCALE1, SCALE2, and SCALE3 for Determination of Scales
on Computer Generated Plots", which perfrom the sort of linear and 
logarithmic scaling you are searching for. The sources are in standard
FORTRAN-IV.

The three routines provide the follwoing services:

	      subroutine scale1(xmin, xmax, n, xminp, xmaxp, dist)
	C
	C Given XMIN,XMAX and N, SCALE1 finds a new range XMINP and
	C XMAXP divisible into approximately N linear intervals
	C of size DIST.
	C VINT is an array of acceptable values for DIST (times
	C an integer power of 10)
	C SQR is an array of geometric means of adjacent values
	C of VINT, it is used as break points to determine
	C which VINT value to assign to DIST
	C
 
	      subroutine scale2(xmin, xmax, n, xminp, xmaxp, dist)
	C
	C Given XMIN, XMAX and N, SCALE2 finds a new range XMINP and
	C XMAXP divisible into exactly N linear intervals of size
	C DIST, where N is greater than 1
	C

	      subroutine scale3(xmin, xmax, n, xminp, xmaxp, dist)
	C
	C Given XMIN, XMAX and N, where N is greater than 1, SCALE3
	C finds a new range XMINP and XMAXP divisible into exactly
	C N logarithmic intervals, where the ratio of adjacent
	C uniformly spaced values is DIST.
	C

I have the code online and will post if interest is high enough (maybe to
mod.sources with an announcement here.

Dick Pierce
Technical Details
Message-ID: <2851@teddy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utcs!mnetor!seismo!think!mit-eddie!genrad!panda!teddy!rdp
References: <14200002@ada-uts>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utcs!mnetor!seismo!think!mit-eddie!genrad!panda!teddy!rdp
From: rdp@teddy.UUCP
Newsgroups: net.graphics
Subject: Re: Scaling graphs
Message-ID: <2851@teddy.UUCP>
Date: Mon, 14-Jul-86 11:35:45 EDT
Article-I.D.: teddy.2851
Posted: Mon Jul 14 11:35:45 1986
Date-Received: Mon, 14-Jul-86 22:36:53 EDT
References: <14200002@ada-uts>
Reply-To: rdp@teddy.UUCP (Richard D. Pierce)
Organization: GenRad, Inc., Concord, Mass.
Lines: 54