Silverfrost Logo About Us | Contact Us
 

Plotting a pie chart

The following code is extracted from program simdem47 in the Simdem package, and it illustrates how easy it is to plot a vector, declared as double precision x(n), as a pie chart. The segment angles are proportional to x(i), so these must all be positive.


c
c initialise essential arguments for default pie chart
c
      do i = 1, n
         x(i) = dble(i)
         write (labels(i),'(a,i2)') 'Segment', i
      enddo
      title = 'Demonstrating a Simfit pie chart'
c
c isend = 1: call pcplot in default mode
c
      isend = 1
      call pcplot (isend, ifill, ihue, n, d, x, labels, title)

   

The following plot is then displayed, and can then be edited to add further features, printed, or archived as a graphics file. It is possible to edit the segment labels, panel key labels, and title, and to perform additional operations like 3D perspective, and segment displacements, or adding descriptive text, or further graphical objects.

 

 

Copyright © 1999-2017 Silverfrost Limited