Histogram and pie chart plotting program wanted

Histogram and pie chart plotting program wanted

Post by Riku Turk » Fri, 20 May 1994 23:08:35



I need Unix (Linux) program to produce histograms and pie charts.
The program should be able to display charts in X windows. Also,
I need to print the charts, so some well known file format support
(that means PostScript and/or gpic) is required. Color charts at
least on display are preferred.

The following programs I have checked out and they don't seem
good enough:
        gnuplot: this can't display pie charts (or can it?)
        gpic: this has no chart plotting features built in,
              also it can fill only simple objects (circles and boxes)

I have found an article about program called grap and that may be
what I'm looking for. Problem is that I don't know where I could
find it and is it freely distributable.

This program is needed as part of a project, so I can't use
commercial programs.

Riku Turkia

 
 
 

Histogram and pie chart plotting program wanted

Post by James Darrell McCaul » Sat, 21 May 1994 06:56:53


[Followups are to: comp.graphics.gnuplot]

for histograms, set the boxes style

|>   gnuplot: this can't display pie charts (or can it?)

sure....

  set polar
  set size 0.721,1.0
  set nozeroaxis
  set noytics      
  set parametric
  set data style line
  plot 1 notit, 'pie.dat' 1

just add a few 'set label' commands and you're almost there.

The "trick" is to format your data properly. For hints, see
the following quick hack that I used to produce pie.dat:

#include<stdio.h>
#include<math.h>
main()
{
  float data[5];
  int i, n=5;
  float asum=0, sum=0;

  data[0]=4.0; data[1]=7.0; data[2]=9.0; data[3]=4.0;

  for(i=0;i<n;++i)
    sum+=data[i];
  for(i=0;i<n;++i)
  {
     asum+=data[i]/sum*360;  /* might need to use a different starting angle */
     /* probably should sort the data - see style guides in the literature
        for plotting pie charts */
     printf("0 0\n%g %g\n\n", asum, 1.0);
  }

Quote:}

maybe there's already a program that does this for the general
case (perhaps writing 'set label' commands to stderr so that
you could separate the two - a fairly trivial task#include<stdio.h>
#include<math.h>
main()
{
  float data[5];
  int i, n=5;
  float asum=0, sum=0;

  data[0]=4.0; data[1]=7.0; data[2]=9.0; data[3]=4.0;
  for(i=0;i<n;++i) sum+=data[i];
  for(i=0;i<n;++i)
  {
     asum+=data[i]/sum*360;
     printf("0 0\n%g %g\n\n", asum, 1.0);
  }

Quote:}

)

|> I have found an article about program called grap and that may be

grap is part of documenters workbench (DWB) from at&t.

--
James Darrell McCauley, Purdue Univ, West Lafayette, IN 47907-1146, USA

** will finish PhD/engr in 9/94 - need job. inquiries welcome (no hh, plz) **
** Personal WWW page URL ftp://pasture.ecn.purdue.edu/pub/mccauley/me.html **

 
 
 

1. Looking for 3D PIE CHART/EXPLODING PIE CHART routines

I have requirements for a WWW-based information system
to generate 3D pie charts and exploding pie charts from
a UNIX Web server.

My system will be using IDL, which doesn't have any circle, ellipse, or
arc graphics primitives, so I need to work from lines, points, and regions.

The routine will be given an array of numbers and a list of labels for each
pie slice.  The output will be a pie chart, 3D pie, and/or exploding slices.
The image will be written to a GIF file and displayed via HTML document.

Has anybody written either an EXPLODING PIE CHART or 3D PIE CHART routines?
I've written a simple LOTUS 123-like pie chart routine, but I need
to find a more sophisticated one that produces Excel and Quattro Pro-like
charts.  Even some C code that can provide he same function would
be helpful, since I could convert it the IDL.

Any help would be appreciated.  Thanks in advance.

Jason

--
-------------------------------------------------------------------------------
Jason Mathews, Code 633.2       |National Space Science Data Center (NSSDC)

Greenbelt, MD 20771-0001  USA   |       (DECnet)   NSSDCA::MATHEWS

2. Seaching root partition for large files?

3. Pie Chart, Bar Char and Histogram in Qt

4. RedHat 2.4.7 & 2.4.9-13 Poweroff failure

5. Software for making pie and bar charts wanted

6. Program to detect CPU or computer (change)

7. Wanted::Scientific Plotting program (with error bar plotting)??

8. Apache: set DocumentRoot based on RemoteAddr

9. libs for pie chart

10. Pie Charts

11. Software to produce pie/bar charts

12. Pie Charts in UNIX?