In this section:
The following code is extracted from program simdem47.f95 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.
! ! initialise essential arguments for default pie chart ! do i = 1, n x(i) = dble(i) write (labels(i),'(a,i2)') 'Segment', i enddo title = 'Demonstrating a Simfit pie chart' ! ! isend = 1: call pcplot in default mode ! 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.