setting the range of an histogram and plotting it to file
Subject: setting the range of an histogram and plotting it to file
From: Antonio Ragagnin
Date: Sat, 4 Apr 2009 10:24:02 +0200
Hi, i'm trying to do an histogram using the package descriptive.
i use it in a batch script so i cannot see it (i think it is closed
when the script finish)
so can i save it in a file?
and, can i set the range of the graph?
i have more group of datas to subdivide in 16 intervals beetween 1.77 and 1.93.
but not all the data files have numbers beetween 1.77 and 1.93,
so, for examples if a group of data have a maximun of 1.85 and a min
of 1.79 "histogram()" divide it in 16 intervals from 1.79 to 1.85.
can i force the division from 1.79 to 1.85??
instead it have done a similar function:
gist(lista, intervallo, min, max, n):=
block(
istogramma: makelist(0,i,1,n),
gaussiana : makelist([0,0],i,1,n),
for elem in lista do
(
cnt:1,
while cnt <= n do
(
if elem>min+((cnt-1)*intervallo) then if elem<=min+((cnt)*intervallo) then
istogramma[cnt] : istogramma[cnt]+1,
cnt:cnt + 1
)
), i:1,
while i <= n do
(
gaussiana[i]:[min+((i-1)*intervallo),istogramma[i]],
i:i+1
),
gaussiana
);
it works, but i don't know how to plot it!!